亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

jquery動(dòng)態(tài)加載js三種方法實(shí)例

 更新時(shí)間:2013年08月03日 10:18:01   作者:  
這里為你提供了三種動(dòng)態(tài)加載js的jquery實(shí)例代碼哦,由于jquery是為用戶提供方便的,所以利用jquery動(dòng)態(tài)加載文件只要一句話$.getScript(\"test.js\");就OK了。
復(fù)制代碼 代碼如下:

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>jquery 動(dòng)態(tài)加載js三種方法</title>
//方法一
<script language="網(wǎng)頁特效">
$.getscript("test.js");
//方法二
function loadjs(file){
     var head = $('head').remove('#loadscript');
    $("<scri"+"pt>"+"</scr"+"ipt>").attr({src:file,type:'text/javascript',id:'load'}).appendto(head);
}
//夠簡單把!如果在濃縮以下你甚至可以用一行代碼全部搞定:
//方法三
$("<scri"+"pt>"+"</scr"+"ipt>").attr({src:file,type:'text/javascript',id:'load'}).appendto($('head').remove('#loadscript'));
</script>

相關(guān)文章

最新評(píng)論