亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

jQuery 使用

jQuery 函式庫可以透過一行簡單的標(biāo)記被加入到網(wǎng)頁中。


可以透過多種方法在網(wǎng)頁中加入 jQuery。 您可以使用以下方法:

  • 從?jquery.com?下載jQuery 函式庫

  • ##從CDN 載入jQuery, 如從Google中載入jQuery


#下載jQuery

有兩個版本的jQuery 可供下載:

  • Production version - 用於實(shí)際的網(wǎng)站中,已被精簡和壓縮。

  • Development version - 用於測試和開發(fā)(未壓縮,是可讀的程式碼)

以上兩個版本都可以從?jquery .com?中下載。


更簡單的使用jQuery方法

#如果您不希望下載並存放jQuery,那麼也可以透過CDN(內(nèi)容分發(fā)網(wǎng)路) 引用它。我們只要從百度、又拍雲(yún)端、新浪、Google或微軟引用jQuery,將它們

放到<head>中即可

<head>
<script?src="jquery-1.10.2.min.js"></script>
</head>
#

下面是個大型網(wǎng)站的CDN

##百度CDN:






#<head>
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
</head>


又拍雲(yún)CDN:

##<head>
<腳本src="http://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.2.min.js">
</script>
</head>


新浪CDN:

#################### ####### #######GoogleCDN:#######

<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
</head>

#提示:我不大建議使用Google CDN來取得版本,因?yàn)镚oogle產(chǎn)品在中國很不穩(wěn)定。
如果您觀察上什麼的 Google URL - 在 URL 中規(guī)定了 jQuery 版本 (1.8.0)。如果您希望使用最新版本的jQuery,也可以從版本字串的結(jié)尾(例如本例1.8)刪除一個數(shù)字,Google會返回1.8 系列中最新的可用版本(1.8.0、1.8.1 等等),或者也可以只剩下第一個數(shù)字,那麼Google會回到1 系列中最新的可用版本(從1.1.0 到1.9.9)。


附註#:本站實(shí)例皆採用百度jQuery CDN函式庫。



#
繼續(xù)學(xué)習(xí)
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js" type="text/javascript"> </script> <script> $(document).ready(function(){ $("p").click(function(){ $(this).hide(); }); }); </script> </head> <body> <p>如果你點(diǎn)我,我就會消失。</p> <p>繼續(xù)點(diǎn)我!</p> <p>接著點(diǎn)我!</p> </body> </html>
提交重置程式碼