不要盲目更新到 Jquery 1.3.2 , 存在内存泄露造成浏览器自动退出

var LDoc = function() {
	this.version = '0.1' ;
	// 月份是从0开始计数的
	this.develop_date = new Date(2009,(7 - 1) ,28 , 15 , 23,45).toLocaleString() ;
	this.appPath = this.getAppPath();
	this.skin = this.skin || 'xp';
	//alert(this.appPath);
} ;

LDoc.prototype = {
	
	getAppPath: function(){
		var script = document.getElementsByTagName("script");		
		for (var i = 0; i < script.length; i++) {			
			var match = script[i].src.match(/.*Lighttpd-docxu.js($|\?.*)/);
			if (match) {
				var matchSkin = script[i].src.match(/.*Lighttpd-docxu\.js\?skin=/);
				if(matchSkin)
					this.skin = script[i].src.replace(/.*Lighttpd-docxu\.js\?skin=/, '');
				return script[i].src.replace(/Lighttpd-docxu\.js.*/, '');
			}			
		}
	} ,
	include: function(f,autoAddSuffix,outside) {
		outside = outside || false ; //outside为true加载外部js
		//autoAddSuffix = autoAddSuffix || true ;//缺省为false
		if (autoAddSuffix) f += ".js" ;
		if (!outside) f = this.appPath + f ; 
		document.write("<script src='@{file}' type='text/javascript'></script>".replace('@{file}',f));
		
	} ,
	
	log: function(){
		alert(this.appPath);
	}
};

var current = new LDoc();
current.log();
current.include('jq-1.2.6.min',true);
current.include('http://www.google.com/jsapi',false,true);

 

出现问题的重现代码如上所示...

 

 

在 将 这行 current.include('jq-1.2.6.min',true);  替换成 current.include('jq-1.3.2.min',true);时,第一次加载没有问题,但是你只要重新刷新2次或者三次,将出现如下界面...

 

 

此 bug 仅仅出现在Firefox上,在IE上没有问题,如果使用jquerry1.2.6则无此问题,jquery1.3.1的版本尚未测试...

 

我的Firefox 版本为:

 

使用FF纯属用来调试JS之用,没有想到用来平时使用,不然就悔死了...

 

这个bug暂时没有找到问题的解决方案,估计是内存泄露造成FF崩溃

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值