今天項目里遇到個問題,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太多,導(dǎo)致每個td調(diào)用格式化數(shù)據(jù)時出了問題,但又不知道怎么修改,求大神賜教。
IE 報JS錯:"stop run this script"。。。
慕哥9229398
2018-12-07 11:43:42