webkit webApp 開發技術要點總結

来源:http://www.cnblogs.com/xhtml5/archive/2016/07/27/5712180.html
-Advertisement-
Play Games

1. viewport:也就是可視區域。對於桌面瀏覽器,我們都很清楚viewport是什麼,就是出去了所有工具欄、狀態欄、滾動條等等之後用於看網頁的區域,這是真正有效的區域。由於移動設備屏幕寬度不同於傳統web,因此我們需要改變viewport; 實際上我們可以操作的屬性有4 個: width - ...


1. viewport:
也就是可視區域。對於桌面瀏覽器,我們都很清楚viewport是什麼,就是出去了所有工具欄、狀態欄、滾動條等等之後用於看網頁的區域,
這是真正有效的區域。由於移動設備屏幕寬度不同於傳統web,因此我們需要改變viewport;

實際上我們可以操作的屬性有4 個:

width -             //  viewport 的寬度 (範圍從200 到10,000,預設為980 像素)

height -            //  viewport 的高度 (範圍從223 到10,000)

 

initial-scale -     //  初始的縮放比例 (範圍從>0 到10)

 

minimum-scale -    //   允許用戶縮放到的最小比例

maximum-scale -    //   允許用戶縮放到的最大比例

 

user-scalable -    //   用戶是否可以手動縮 (no,yes)


那麼到底這些設置如何讓Safari 知道?其實很簡單,就一個meta,形如:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">   //編碼

<meta id="viewport" name="viewport" content="width=320; initial-scale=1.0;maximum-scale=1.0; user-scalable=no;"/>

<meta name=”apple-mobile-web-app-capable” content=”yes” />  // 離線應用的另一個技巧     

<meta name=”apple-mobile-web-app-status-bar-style” content=black” />  // 隱藏狀態欄        

<meta content="black" name="apple-mobile-web-app-status-bar-style" /> //指定的iphone中safari頂端的狀態條的樣式        

<meta content="telephone=no" name="format-detection" />       //告訴設備忽略將頁面中的數字識別為電話號碼      

<meta name="Author" contect="Mr.He"/ >  


在設置了initial-scale=1 之後,我們終於可以以1:1 的比例進行頁面設計了。關於viewport,還有一個很重要的概念是:iphone 的safari 瀏覽器完全沒有滾動條,而且不是簡單的“隱藏滾動條”,是根本沒有這個功能。iphone 的safari 瀏覽器實際上從一開始就完整顯示了這個網頁,然後用viewport 查看其中的一部分。當你用手指拖動時,其實拖的不是頁面,而是viewport。瀏覽器行為的改變不止是滾動條,交互事件也跟普通桌面不一樣。(請參考:指尖的下JS 系列文章)

2. link:

<link rel=”apple-touch-startup-image” href=”startup.png” /> // 設置開始頁面圖片

<link rel=”apple-touch-icon” href=”iphon_tetris_icon.png”/> // 在設置書簽的時候可以顯示好看的圖標

<link rel="stylesheet" media="all and (orientation:portrait)" href="portrait.css">    // 肖像模式樣式       

<link rel="stylesheet" media="all and (orientation:landscape)" href="landscape.css"   // 風景模式樣式

 

//豎屏時使用的樣式 

<style media="all and (orientation:portrait)" type="text/css">

#landscape { display: none; }

</style>

 

//橫屏時使用的樣式 

<style media="all and (orientation:landscape)" type="text/css">

#portrait { display: none; }

</style>  


3. 事件 : (請參考:指尖的下JS 系列文章)

// 手勢事件

touchstart            //當手指接觸屏幕時觸發

touchmove           //當已經接觸屏幕的手指開始移動後觸發

touchend             //當手指離開屏幕時觸發

touchcancel

 

// 觸摸事件

gesturestart          //當兩個手指接觸屏幕時觸發

gesturechange      //當兩個手指接觸屏幕後開始移動時觸發

gestureend

 

// 屏幕旋轉事件   

onorientationchange     

 

// 檢測觸摸屏幕的手指何時改變方向       

orientationchange       

 

// touch事件支持的相關屬性

touches         

targetTouches       

changedTouches              

clientX    // X coordinate of touch relative to the viewport (excludes scroll offset)       

clientY    // Y coordinate of touch relative to the viewport (excludes scroll offset)       

screenX    // Relative to the screen        

screenY     // Relative to the screen       

pageX     // Relative to the full page (includes scrolling)     

pageY     // Relative to the full page (includes scrolling)     

target     // Node the touch event originated from      

identifier     // An identifying number, unique to each touch event


4. 屏幕旋轉事件:onorientationchange
添加屏幕旋轉事件偵聽,可隨時發現屏幕旋轉狀態(左旋、右旋還是沒旋)。例子:

// 判斷屏幕是否旋轉

function orientationChange() { 

    switch(window.orientation) { 

      case 0:  

            alert("肖像模式 0,screen-width: " + screen.width + "; screen-height:" + screen.height); 

            break; 

      case -90:  

            alert("左旋 -90,screen-width: " + screen.width + "; screen-height:" + screen.height); 

            break; 

      case 90:    

            alert("右旋 90,screen-width: " + screen.width + "; screen-height:" + screen.height); 

            break; 

      case 180:    

          alert("風景模式 180,screen-width: " + screen.width + "; screen-height:" + screen.height); 

          break; 

    };<br>};

// 添加事件監聽 

addEventListener('load', function(){ 

    orientationChange(); 

    window.onorientationchange = orientationChange; 

});


5. 隱藏地址欄 & 處理事件的時候,防止滾動條出現:

// 隱藏地址欄  & 處理事件的時候 ,防止滾動條出現

addEventListener('load', function(){ 

        setTimeout(function(){ window.scrollTo(0, 1); }, 100); 

});


6. 雙手指滑動事件:

// 雙手指滑動事件

addEventListener('load',  function(){ window.onmousewheel = twoFingerScroll;}, 

     false              // 相容各瀏覽器,表示在冒泡階段調用事件處理程式 (true 捕獲階段)

); 

function twoFingerScroll(ev) { 

    var delta =ev.wheelDelta/120;              //對 delta 值進行判斷(比如正負) ,而後執行相應操作 

    return true; 

}; 


7. 判斷是否為iPhone:

// 判斷是否為 iPhone : 

function isAppleMobile() { 

    return (navigator.platform.indexOf('iPad') != -1); 

}; 


8. localStorage:
 例子 :(註意數據名稱  n  要用引號引起來)

var v = localStorage.getItem('n') ? localStorage.getItem('n') : "";   // 如果名稱是  n 的數據存在 ,則將其讀出 ,賦予變數  v  。 

localStorage.setItem('n', v);                                           // 寫入名稱為 n、值為  v  的數據 

localStorage.removeItem('n');                                           // 刪除名稱為  n  的數據    


9. 使用特殊鏈接:
 如果你關閉自動識別後 ,又希望某些電話號碼能夠鏈接到 iPhone 的撥號功能 ,那麼可以通過這樣來聲明電話鏈接 ,

<a href="tel:12345654321">打電話給我</a>

<a href="sms:12345654321">發簡訊</a>

或用於單元格:

<td onclick="location.href='tel:122'">


10. 自動大寫與自動修正
要關閉這兩項功能,可以通過autocapitalize 與autocorrect 這兩個選項:

<input type="text" autocapitalize="off" autocorrect="off" />


11. WebKit CSS:
①“盒模型”的具體描述性質的包圍盒塊內容,包括邊界,填充等等。

-webkit-border-bottom-left-radius: radius;

-webkit-border-top-left-radius: horizontal_radius vertical_radius;

-webkit-border-radius: radius;      //容器圓角

-webkit-box-sizing: sizing_model; 邊框常量值:border-box/content-box

-webkit-box-shadow: hoff voff blur color; //容器陰影(參數分別為:水平X 方向偏移量;垂直Y 方向偏移量;高斯模糊半徑值;陰影顏色值)

-webkit-margin-bottom-collapse: collapse_behavior; 常量值:collapse/discard/separate

-webkit-margin-start: width;

-webkit-padding-start: width;

-webkit-border-image: url(borderimg.gif) 25 25 25 25 round/stretch round/stretch;

-webkit-appearance: push-button;   //內置的CSS 表現,暫時只支持push-button

②“視覺格式化模型”描述性質,確定了位置和大小的塊元素。

direction: rtl

unicode-bidi: bidi-override; 常量:bidi-override/embed/normal

③“視覺效果”描述屬性,調整的視覺效果塊內容,包括溢出行為,調整行為,能見度,動畫,變換,和過渡。

clip: rect(10px, 5px, 10px, 5px)

resize: auto; 常量:auto/both/horizontal/none/vertical

visibility: visible; 常量: collapse/hidden/visible

-webkit-transition: opacity 1s linear; 動畫效果 ease/linear/ease-in/ease-out/ease-in-out

-webkit-backface-visibility: visibler; 常量:visible(預設值)/hidden

-webkit-box-reflect: right 1px; 鏡向反轉

-webkit-box-reflect: below 4px -webkit-gradient(linear, left top, left bottom,

from(transparent), color-stop(0.5, transparent), to(white));

-webkit-mask-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));;   //CSS 遮罩/蒙板效果

-webkit-mask-attachment: fixed; 常量:fixed/scroll

-webkit-perspective: value; 常量:none(預設)

-webkit-perspective-origin: left top;

-webkit-transform: rotate(5deg);

-webkit-transform-style: preserve-3d; 常量:flat/preserve-3d; (2D 與3D)

④“生成的內容,自動編號,併列出”描述屬性,允許您更改內容的一個組成部分,創建自動編號的章節和標題,和操縱的風格清單的內容。

content: “Item” counter(section) ” “;

This resets the counter.

First section

>two section

three section

counter-increment: section 1;

counter-reset: section;

⑤“分頁媒體”描述性能與外觀的屬性,控制印刷版本的網頁,如分頁符的行為。

page-break-after: auto; 常量:always/auto/avoid/left/right

page-break-before: auto; 常量:always/auto/avoid/left/right

page-break-inside: auto; 常量:auto/avoid

⑥“顏色和背景”描述屬性控制背景下的塊級元素和顏色的文本內容的組成部分。

-webkit-background-clip: content; 常量:border/content/padding/text

-webkit-background-origin: padding; 常量:border/content/padding/text

-webkit-background-size: 55px; 常量:length/length_x/length_y

⑦ “字型”的具體描述性質的文字字體的選擇範圍內的一個因素。報告還描述屬性用於下載字體定義。

unicode-range: U+00-FF, U+980-9FF;

⑧“文本”描述屬性的特定文字樣式,間距和自動滾屏。

text-shadow: #00FFFC 10px 10px 5px;

text-transform: capitalize; 常量:capitalize/lowercase/none/uppercase

word-wrap: break-word; 常量:break-word/normal

-webkit-marquee: right large infinite normal 10s; 常量:direction(方向) increment(迭代次數) repetition(重覆) style(樣式) speed(速度);

-webkit-marquee-direction: ahead/auto/backwards/down/forwards/left/reverse/right/up

-webkit-marquee-incrementt: 1-n/infinite(無窮次)

-webkit-marquee-speed: fast/normal/slow

-webkit-marquee-style: alternate/none/scroll/slide

-webkit-text-fill-color: #ff6600; 常量:capitalize, lowercase, none, uppercase

-webkit-text-security: circle; 常量:circle/disc/none/square

-webkit-text-size-adjust: none; 常量:auto/none;

-webkit-text-stroke: 15px #fff;

-webkit-line-break: after-white-space; 常量:normal/after-white-space

-webkit-appearance: caps-lock-indicator;

-webkit-nbsp-mode: space; 常量: normal/space

-webkit-rtl-ordering: logical; 常量:visual/logical

-webkit-user-drag: element; 常量:element/auto/none

-webkit-user-modify: read- only; 常量:read-write-plaintext-only/read-write/read-only

-webkit-user-select: text; 常量:text/auto/none

⑨“表格”描述的佈局和設計性能表的具體內容。

-webkit-border-horizontal-spacing: 2px;

-webkit-border-vertical-spacing: 2px;

-webkit-column-break-after: right; 常量:always/auto/avoid/left/right

-webkit-column-break-before: right; 常量:always/auto/avoid/left/right

–webkit-column-break-inside: logical; 常量:avoid/auto

-webkit-column-count: 3; //分欄

-webkit-column-rule: 1px solid #fff;

style:dashed,dotted,double,groove,hidden,inset,none,outset,ridge,solid

⑩“用戶界面”描述屬性,涉及到用戶界面元素在瀏覽器中,如滾動文字區,滾動條,等等。報告還描述屬性,範圍以外的網頁內容,如游標的標註樣式和顯示當您按住觸摸觸摸
目標,如在iPhone上的鏈接。

-webkit-box-align: baseline,center,end,start,stretch 常量:baseline/center/end/start/stretch

-webkit-box-direction: normal;常量:normal/reverse

-webkit-box-flex: flex_valuet

-webkit-box-flex-group: group_number

-webkit-box-lines: multiple; 常量:multiple/single

-webkit-box-ordinal-group: group_number

-webkit-box-orient: block-axis; 常量:block-axis/horizontal/inline-axis/vertical/orientation

–webkit-box-pack: alignment; 常量:center/end/justify/start


12. 動畫過渡
這是 Webkit 中最具創新力的特性:使用過渡函數定義動畫。

-webkit-animation: title infinite ease-in-out 3s;

animation 有這幾個屬性:

-webkit-animation-name: //屬性名,就是我們定義的keyframes

-webkit-animation-duration:3s //持續時間

-webkit-animation-timing-function: //過渡類型:ease/ linear(線性) /ease-in(慢到快)/ease-out(快到慢) /ease-in-out(慢到快再到慢) /cubic-bezier

-webkit-animation-delay:10ms //動畫延遲(預設0)

-webkit-animation-iteration-count: //迴圈次數(預設1),infinite 為無限

-webkit-animation-direction: //動畫方式:normal(預設 正向播放); alternate(交替方向,第偶數次正向播放,第奇數次反向播放)

這些同樣是可以簡寫的。但真正讓我覺的很爽的是keyframes,它能定義一個動畫的轉變過程供調用,過程為0%到100%或from(0%)到to(100%)。簡單點說,只要你有想法,你想讓元素在這個過程中以什麼樣的方式改變都是很簡單的。

-webkit-transform: 類型(縮放scale/旋轉rotate/傾斜skew/位移translate)

scale(num,num) 放大倍率。scaleX 和 scaleY(3),可以簡寫為:scale(* , *)

rotate(*deg) 轉動角度。rotateX 和 rotateY,可以簡寫為:rotate(* , *)

Skew(*deg) 傾斜角度。skewX 和skewY,可簡寫為:skew(* , *)

translate(*,*) 坐標移動。translateX 和translateY,可簡寫為:translate(* , *)。

實現模擬彈出消息框(Alert)的例子:
①定義過渡(在<style type="text/css">段中描述keyframes):

@-webkit-keyframes DivZoom

{

0% { -webkit-transform: scale(0.01) }

60% { -webkit-transform: scale(1.05) }

80% { -webkit-transform: scale(0.95) }

100% { -webkit-transform: scale(1.00) }

}

.sZoom { -webkit-animation: DivZoom 0.5s ease-in-out }

(很容易看懂,將元素從縮小的0.01 倍--很小但不能為0 倍,放大到1.05 倍,再縮小到0.95倍,最後到1 倍即正常大小。整個過渡過程事件為0.5 秒,動畫方式為ease-in-out,即慢到快再到慢,預設只進行1 次過渡。這正是大家經常看到的 iPhone 彈出的提示信息的動畫效果!)
②定義元素(在<body>段中):

<div id="layerH" style="-webkit-border-radius:12px; border:2px solid #FFF;-webkit-box-shadow: 0px 2px 4px #888;position: absolute; left: 24px; top: 106px;

width: 256px; height: 268px; padding-left: 8px; padding-right: 8px;color: #FFFFFF; text-shadow: 1px 1px 1px #000; text-align: center;

background-image:url('BG-Msg.png'); background-repeat:no-repeat;

z-index: 1; visibility: hidden; ">

<p><span style="font-size: 16pt; font-weight: bold">使用說明</span></p>

<hr noshade size="1">

<div id="HelpText" style="height: 120px">說明文字</div>

<hr noshade size="1">

<form name="formV" method="POST">

<input type="button" value="確認" name="B1"

style="width: 100%; height: 40px; font-size: 14pt; ont-weight: bold;

color: #FFFFFF; text-shadow: 0px -1px 1px #000;"

onclick=" layerH.style.visibility='hidden'">

</form>

</div>

③啟動動畫(在 javascript 定義的函數中)

function pHelp()

{

layerH.style.visibility = 'visible'

layerH.style.cssText = "-webkit-animation-delay: " + Math.random() + "ms"

layerH.className = 'sZoom'

}

(這個啟動函數就很好理解了。但是為什麼要使用-webkit-animation-delay 這句呢?因為當一個元素過渡顯示完成後,若其樣式沒有變化,下一次將無法進行過渡動畫顯示。我們巧妙的利用其動畫延遲時間定義,使其有所變化,就避免了上述問題。其中使用隨機數函數Math.random(),產生一個大於0 小於1 的隨機數。當然,延遲零點幾毫秒,用戶是不會察覺的。)

補充:
1. 鎖定 viewport

ontouchmove="event.preventDefault()" //鎖定viewport,任何屏幕操作不移動用戶界面(彈出鍵盤除外)。

2. 被點擊元素的外觀變化,可以使用樣式來設定:

-webkit-tap-highlight-color: 顏色

3. 偵測iPhone/iPod
開發特定設備的移動網站,首先要做的就是設備偵測了。下麵是使用Javascript偵測iPhone/iPod的UA,然後轉向到專屬的URL。

if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {

  if (document.cookie.indexOf("iphone_redirect=false") == -1) {

    window.location = "http://m.example.com";

  }

}

雖然Javascript是可以在水果設備上運行的,但是用戶還是可以禁用。它也會造成客戶端刷新和額外的數據傳輸,所以下麵是伺服器端偵測和轉向:

if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod')) {

  header('Location: http://yoursite.com/iphone');

  exit();

}

4. 阻止旋轉屏幕時自動調整字體大小

html, body, form, fieldset, p, div, h1, h2, h3, h4, h5, h6 {-webkit-text-size-adjust:none;}

5. iPhone才識別的CSS
如果不想設備偵測,可以用CSS媒體查詢來專為iPhone/iPod定義樣式。

@media screen and (max-device-width: 480px) {}

6. 縮小圖片
網站的大圖通常寬度都超過480像素,如果用前面的代碼限制了縮放,這些圖片在iPhone版顯示顯然會超過屏幕。好在iPhone機能還夠,我們可以用CSS讓iPhone自動將大圖片縮小顯示。

@media screen and (max-device-width: 480px){

  img{max-width:100%;height:auto;}

}

7. 模擬:hover偽類
因為iPhone並沒有滑鼠指針,所以沒有hover事件。那麼CSS :hover偽類就沒用了。但是iPhone有Touch事件,onTouchStart 類似 onMouseOver,onTouchEnd 類似 onMouseOut。所以我們可以用它來模擬hover。使用Javascript:

var myLinks = document.getElementsByTagName('a');

for(var i = 0; i < myLinks.length; i++){

  myLinks[i].addEventListener(’touchstart’, function(){this.className = “hover”;}, false);

  myLinks[i].addEventListener(’touchend’, function(){this.className = “”;}, false);

}

然後用CSS增加hover效果:

a:hover, a.hover { /* 你的hover效果 */ }

這樣設計一個鏈接,感覺可以更像按鈕。並且,這個模擬可以用在任何元素上。


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 如果元素有屬性 'position:absolute',containing block 由最近的 position 不是 static 的祖先建立,按下麵的步驟: 1、如果祖先是塊級元素,containing block 由祖先的 padding edge(除 margin, border 外的區 ...
  • 演示地址:http://admintemplate.webplus.org.cn/ v1.0 (2016/7/27) 扁平化風格 全屏支持 後臺管理不使用iframe,全ajax開發 許可權管理 商品管理 整合ckeditor及ckfinder 集成highcharts圖表插件 任何地方實現文件的上傳 ...
  • ECMAScript 變數:1.基本類型值(簡單數據段) 2.引用類型值(可能由過個值構成的對象) → 保存在記憶體中的對象 動態屬性: 只能給引用型值動態添加新屬性,以便將來使用。 複製變數值 : 基本類型值的複製 → 在變數對象上創建一個新值 → 複製給新變數(互不影響) 引用類型值的複製 → 將 ...
  • 序 聽過JS,聽過Node,也聽過Node.js,還聽過npm,然而並不是很清楚的知道都代表什麼,這兩天調介面,然後前端同學很忙,就自己把前端代碼拿過來跑了,也趁機瞭解一下這幾個概念,下邊做個小的總結吧。 Node和Node.js JS就不用說了,一種解釋型語言,前端用的較多,目前也出現在伺服器端。 ...
  • 首先,在製作網頁中,想實現在點擊提交按鈕後,根據當前按鈕的不同,將按鈕信息附加到鏈接的後邊,如下圖所示: 上圖中,鏈接後的id=LJQ,就是實現帶參數跳轉,之後便於在跳轉頁根據id=X;根據x不同,實現不同載入圖片等內容; 接下來是如何實現帶參數跳轉: 接下來講解,如何對帶參數鏈接進行解析呢? 解釋 ...
  • 1.閃現方式的輪播 不論述,實現比較簡單,效果也比較好 2.滑動輪播 以下麵的html代碼為例(向左滑動) 插件源碼:實現向左和向上輪播,手動切換也是向左和向上切換(手動切換關鍵源碼) 滑動輪播的實現方式主要有兩種 1)切換父元素margin-left,將第一個子元素不斷添加到父容器結尾 簡單實現 ...
  • 前端能獲得的時間有兩種:客戶端與伺服器的時間. 如何獲取伺服器當前時間,主要是處理客戶端本地機器時間錯誤問題。 方法一:原理:獲取伺服器返回的頭部信息中的Date屬性 由於得到的是GMT(格林尼治時間) 所以要轉換成東八區的時間 這個就是響應伺服器的當前時間。var date = new Date( ...
  • ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...