jQuery Mobile 安裝

2018-02-02 17:08 更新

jQuery Mobile 安裝

在開(kāi)始使用 jQuery Mobile 前,您需要先安裝它,本節(jié)教您如何正確安裝 jQuery Mobile。

在你的網(wǎng)頁(yè)中添加 jQuery Mobile

你可以通過(guò)以下幾種方式將jQuery Mobile添加到你的網(wǎng)頁(yè)中:

  • 從 CDN 中加載 jQuery Mobile (推薦)
  • 從 jQuerymobile.com 下載 jQuery Mobile庫(kù)

從 CDN 中加載 jQuery Mobile

lamp CDN的全稱(chēng)是Content Delivery Network,即內(nèi)容分發(fā)網(wǎng)絡(luò)。其基本思路是盡可能避開(kāi)互聯(lián)網(wǎng)上有可能影響數(shù)據(jù)傳輸速度和穩(wěn)定性的瓶頸和環(huán)節(jié),使內(nèi)容傳輸?shù)母?、更穩(wěn)定。.

使用 jQuery 內(nèi)核, 你不需要在電腦上安裝任何東西; 你僅僅需要在你的網(wǎng)頁(yè)中加載以下層疊樣式 (.css) 和 JavaScript 庫(kù) (.js) 就能夠使用 jQuery Mobile:

jQuery Mobile CDN:

<head>
<link rel="stylesheet" rel="external nofollow" target="_blank" >
<script src="http://code.jquery.com/jquery-1.8.3.min.js" rel="external nofollow" ></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js" rel="external nofollow" ></script>
</head>

嘗試一下 ?


下載 jQuery Mobile

如果你想將 jQuery Mobile 放于你的主機(jī)中,你可以從 jQuerymobile.com下載該文件。

<head>
<link rel=stylesheet href=jquery.mobile-1.3.2.css>
<script src=jquery.js></script>
<script src=jquery.mobile-1.3.2.js></script>
</head>

提示: 將下載的文件放置于與網(wǎng)頁(yè)同一目錄下。

lamp 你是否想知道為什么在 <script> 標(biāo)簽中 沒(méi)有插入 type="text/javascript" ?

在 HTML5 已經(jīng)不需要該屬性。 JavaScript 在所有現(xiàn)代瀏覽器中是 HTML5 的默認(rèn)腳本語(yǔ)言!
以上內(nèi)容是否對(duì)您有幫助:
在線(xiàn)筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)