您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> Web开发 >> IE 报JS错:"stop run this script"。。。

IE 报JS错:"stop run this script"。。。

来源:网络整理     时间:2016/5/21 3:08:45     关键词:script,this

关于网友提出的“IE 报JS错:"stop run this script"。。。”问题疑问,本网通过在网上对“IE 报JS错:"stop run this script"。。。”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题:IE 报JS错:"stop run this script"。。。
描述:

今天项目里遇到个问题,JS报错:“stop run this script”(IE浏览器

代码如下:

$("#tableID").find('.tdClass').each(function(){

//遍历table里的每个td 
$(this).html(numberFormat($(this).text().replace(/\,/g,'')));

});

function numberFormat(num){

                  if(num.indexOf("-") == -1 || num.length > 2){

                        if(num.indexOf("%") == -1){

                              return formatCurrency(Math.round(Number(num)));

                        }else{

                              return Number(num.replace("%","")).toFixed(1)+"%";

                        }

                  }

            }

因为table里有灰常灰常多的td,所以本人感觉是因为td太多,导致每个td调用格式化数据时出了问题,但又不知道怎么修改,求大神赐教。


解决方案1:

语句好像没什么问题,应该就是javascript的效率问题。你逐行注释掉,看看哪里效率损失的大,然后进行优化。

解决方案2:

试试$("#tableID").find('td.Class')


以上介绍了“IE 报JS错:"stop run this script"。。。”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/1207704.html

相关图片

相关文章