2013-02-21 44 views
2

加載jqGrid的我得到了如下錯誤:不能在IE7

SCRIPT1028: Expected identifier, string or number recruit.html;jsessionid=1f7j1qesicu7u, line 646 character 56

var pagerPrevTD = $('<td>', {class: "myPager"}), prevPagesIncluded = 0, 
pagerNextTD = $('<td>', { class: "myPager"}), nextPagesIncluded = 0, 
totalStyle = grid[0].p.pginput === false, 
startIndex = totalStyle? this.p.page-MAX_PAGERS*2: this.p.page-MAX_PAGERS; 

回答

2

我想你應該更換{class: "myPager"}

{"class": "myPager"} 

,因爲舊版本的Internet Explorer的解釋class作爲不能被引用的保留字。

您可以將$('<td>', {class: "myPager"})重寫爲$("<td>").addClass("myPager")或僅使用$("<td class='myPager'></td>")