一种很常见的写法:
document.write('<scr'+'ipt src="http://a.com/b.js" type="text/javascript"></scr'+'ipt>');
直到被杀毒软件提示有恶意代码才发现这也是不安全的,汗……
那就只好改成这样了:
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = 'http://a.com.cn/b.js';
document.getElementsByTagName('head')[0].appendChild(s);
})();
搜了一下,原来还有“邪恶”的eval,具体可以看这里:网马解密大讲堂——网马解密中级篇(Document.write篇)。
您可能对这些文章也感兴趣:- 用Silverlight(C#)调用JavaScript中的方法
- onclick在前还是onblur在前?
- Mootools 1.2教程(14)——定时器和哈希简介
- Mootools 1.2教程(18)——类(一)
- Show一下VS 2008下的javascript的intellisense
- Mootools 1.2教程(9)——输入过滤第二部分(字符串)
- 最新版瑞星和MooTools冲突了
- Mootools常用方法扩展(四)
- 网页自适应不同分辨率显示
- 点击显示/隐藏部分页面
与该文相关的评论:(我也想说几句)
Copyright © 2005-2008,Fdream All Rights Reserved
Processed in 0.0625008 second(s) , unknow queries
Powered by OWord V0.1, Even Not Alpha
(此博客程序为半成品,请勿索取,以免给您的心灵造成创伤^_^)
鄂ICP备05026031号
Processed in 0.0625008 second(s) , unknow queries
Powered by OWord V0.1, Even Not Alpha
(此博客程序为半成品,请勿索取,以免给您的心灵造成创伤^_^)
鄂ICP备05026031号
2009-9
我来说两句:
用户中心
日志分类

最新日志
统计信息





