javascript - IE7无法加载jqgrid

标签 javascript jquery jqgrid

我收到以下错误:

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;

最佳答案

我想你应该替换 {class: "myPager"}

{"class": "myPager"}

因为旧版本的 Internet Explorer 解释 class作为保留字,不加引号就不能用作属性。

您可以重写$('<td>', {class: "myPager"})$("<td>").addClass("myPager")或者只使用$("<td class='myPager'></td>")

关于javascript - IE7无法加载jqgrid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14994244/

相关文章:

javascript - jQueryUI .extend 的困境

Javascript:语法错误,无法识别的表达式:<h1>

javascript - jqGrid 4.0 bindKeys 方法使用上下箭头键移动整个网格

javascript - 在 RxJ 中使用背压进行击键

如果类选择器缺少第二类,则 Jquery 添加第二类

jquery - 带有 jqgrid 的三页脚行无法正常工作

php - JqG​​rid 服务器端查询与搜索冲突

javascript - 创建多个稍后在 react 中访问的组件(例如更改它们的高度)

javascript - 动态 MVC 多部分下拉列表

javascript - 在discord.js中设置用户的昵称