IE8中的换行代码

Line breaking code in IE8

本文关键字:代码 换行 IE8      更新时间:2024-01-25

这一行似乎破坏了我在IE8中的代码,有人能告诉我为什么是吗

data=[];
item=someElementWithTextInside
//line below breaks it
data.push({obj: item, text: item.innerHTML.replace(/^'s+/, "").replace(/'s+$/, ""))}; 
//line above breaks

我已经尝试过查看它的innerHTML部分,该函数在我的浏览器上似乎运行良好(切换到innerText不会产生任何影响)

行末尾应该有)});,而不是))};