jquery动态加载 去除js
2014-01-06 15:15
183 查看
!-- 这里为你提供了三种动态加载js的jquery实例代码哦,由于jquery是为用户提供方便的,所以利用jquery动态加载文件只要一句话$.getscript("test.js");就ok了。
<!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 动态加载js三种方法</title>
<script language="网页特效">
$.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>
</head>
<body>
</body>
</html>
jquery去除js
$("script[src='../static/js/cpu_memory.js']").remove();
$("script[src='../static/js/wan_flow.js']").remove();
<!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 动态加载js三种方法</title>
<script language="网页特效">
$.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>
</head>
<body>
</body>
</html>
jquery去除js
$("script[src='../static/js/cpu_memory.js']").remove();
$("script[src='../static/js/wan_flow.js']").remove();
相关文章推荐
- jquery动态加载 去除js
- 三种动态加载js的jquery实例代码另附去除js方法
- 三种动态加载js的jquery实例代码另附去除js方法
- jquery js 动态加载表格
- 【jquery】Chosen.jquery.js 插件动态加载数据问题
- jquery getScript动态加载JS方法改进详解
- jQuery的load方法设计动态加载及解决被加载页面js
- jquery getScript动态加载JS方法改进详解
- (一)JQuery动态加载js的三种方法
- 使用jquery动态加载js文件的方法
- jQuery动态加载JS以减少服务器压力
- js/jquery控制页面动态加载数据 滑动滚动条自动加载事件的方法
- jquery动态加载js,css文件
- jQuery动态加载JS以减少服务器压力
- JQuery条件下使用 JS方式实现百度地图加载数据库中的坐标并实现动态刷新
- jquery动态加载js三种方法实例
- jquery动态加载js/css文件方法
- 垂直手风琴5级菜单!用js+jquery动态加载菜单,附上源码hezhu和注释
- jquery动态加载js/css文件方法
- [JS前端开发] js/jquery控制页面动态加载数据 滑动滚动条自动加载事件