<table><tbody><tr><td></td></tr></tbody></table>
jquery :
$(tbody).children().each(function(){})
此方法在firefox 中,运行正常。
在ie8中运行出错。问题是children
改成
$(tbody).find("tr").each(function(){})
运行OK!
本文探讨了在IE8浏览器中使用jQuery时遇到的children方法运行错误问题,并提供了解决方案:通过使用find方法替代children方法,使得代码在IE8环境下也能正常运行。
<table><tbody><tr><td></td></tr></tbody></table>
jquery :
$(tbody).children().each(function(){})
此方法在firefox 中,运行正常。
在ie8中运行出错。问题是children
改成
$(tbody).find("tr").each(function(){})
运行OK!

被折叠的 条评论
为什么被折叠?