jquery动态加载 去除js
2015-12-08 22:50
651 查看
!-- 这里为你提供了三种动态加载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" />
//方法二
//够简单把!如果在浓缩以下你甚至可以用一行代码全部搞定:
//方法三
$("<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" />
//方法二
function loadjs(file){
var head = $('head').remove('#loadscript');
$("<scri"+"pt>"+"</scr"+"ipt>").attr({src:file,type:'text/javascript',id:'load'}).appendto(head);
}
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 —— 选择器
- jquery data()
- jquery.tmpl.js
- jquery.tmpl.min.js
- jquery学习(三)-ajax
- jquery学习(四)-如何书写自定义的jquery插件
- jquery学习(二)-DOM操作
- jquery学习(一)-选择器
- jquery得到iframe src属性值的方法
- jquery-2.1.4 源码解读(2):jQuery.fn.init 构造函数解读
- Jquery 中DOM对象操作
- MyEclipse中jquery.js文件报missing semicolon的错误解决
- 使用Jquery clone添加多行数据
- JQuery--隐藏和显示
- 15个值得开发人员关注的jQuery开发技巧和心得
- 模拟上传头像支持截图
- html5 jqueryrotate插件实现旋转动画
- html5 jqueryrotate插件实现旋转动画
- html5 jqueryrotate插件实现旋转动画
- jQuery 1.9 .live() is not a function