jQuery Mobile Installation
- Previous Page jQuery Mobile Introduction
- Next Page jQuery Mobile Page
向您的網頁添加 jQuery Mobile
有多个办法可供您在网站上开始使用 jQuery Mobile。您可以:
- 從 CDN 引用 jQuery Mobile(推薦)
- 從 jQuerymobile.com 下載 jQuery Mobile 圖書館
從 CDN 引用 jQuery Mobile
Tip:CDN (Content Delivery Network) 用於通過 web 分發常用的檔案,以此加快速用戶的下載速度。
與 jQuery 類似,無需在您的電腦上安裝任何程序;您只需直接在 HTML 頁面中引用以下樣式表和 JavaScript 圖書館,這樣 jQuery Mobile 就可以工作了:
jQuery Mobile CDN:
<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>
下载 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>
Tip:Ilagay ang inilagay na file sa folder na gusto mong gamitin.
Tip:Naisip mo ba kung bakit walang attribute na type="text/javascript" sa <script> tag?
Ang attribute na ito ay hindi kinakailangan sa HTML5. Ang JavaScript ay ang default na script language ng HTML5 at lahat ng modernong browser!
- Previous Page jQuery Mobile Introduction
- Next Page jQuery Mobile Page