我已经编写了一个jQuery代码来从HTML中的TR标签获取属性。该代码适用于IE 8,但是当我在IE 9中运行该代码时,出现“预期的功能”错误。代码如下:Jquery - 在IE 9中从TR html标签获取属性
$(".grid tr").each(function() {
//I've inserted an attribute called idRow in each grid row.
if(this.attributes("idRow") != null) //I get the "Function expected error" here
{
...
}
});
什么是代码问题?为什么它在IE 8中工作?
谢谢!你知道我的代码为什么在IE 8中工作吗? – Leila 2012-02-10 19:11:04
@Leila:我猜他们最初有'属性'对象作为可调用的函数/对象,但是他们努力达到更符合标准的要求,移除了这个能力。 – 2012-02-10 19:14:01
有道理......非常感谢! – Leila 2012-02-10 19:15:48