我已經編寫了一個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