標籤:style blog class code java tar
一、什麼是 jQuery Mobile?
jQuery Mobile 是一個為觸控最佳化的架構,用於建立移動 web 應用程式。
jQuery 適用於所有流行的智能手機和平板電腦:
jQuery Mobile 構建於 jQuery 庫之上,這使其更易學習,如果您通曉 jQuery 的話。
它使用 HTML5、CSS3、JavaScript 和 AJAX 通過儘可能少的代碼來完成對頁面的布局。
二、向網頁中添加 jQuery Mobile
1、從 CDN 引用 jQuery Mobile(推薦)
CDN (Content Delivery Network) 用於通過 web 來分發常用的檔案,以此加快使用者的下載速度。與 jQuery 類似,無需在您的電腦上安裝任何程式;您只需直接在 HTML 頁面中引用以下樣式表和 JavaScript 庫,這樣 jQuery Mobile 就可以工作了:
<head><link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css"><script src="http://code.jquery.com/jquery-1.8.3.min.js"></script><script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script></head>
2、從 jQuerymobile.com 下載 jQuery Mobile 庫
如果您希望在伺服器上存放 jQuery Mobile,您可以從 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>
提示:請將下載的檔案放到您希望使用的檔案夾中。
提示:您是不是奇怪為什麼 <script> 標籤中沒有 type="text/javascript" 屬性?在 HTML5 中該屬性不是必需的。JavaScript 是 HTML5 以及所有現代瀏覽器中的預設指令碼語言!