【问题标题】:Templating plugin Pure.js causes infinite loop IE 9模板插件 Pure.js 导致无限循环 IE 9
【发布时间】:2013-02-27 19:41:10
【问题描述】:

我使用 pure.js 1.29(用于 HTML 的 PURE Unobtrusive Rendering Engine)作为我的排序/分页/过滤的 js 模板语言。出于某种原因,当我尝试该页面时,IE 9 崩溃了。 IE 7、8、FF、Chrome 都可以正常渲染。

【问题讨论】:

    标签: javascript internet-explorer template-engine


    【解决方案1】:

    它导致 IE 9 中的无限循环。pure.js 的第 362 行:

    ie = attValue.match(/#\{[^\}]*\}/);
    if (!ie && attValue !== '') {attValues.push(attValue);}}}
    

    ie 正在返回导致循环的“未定义”。所以用下面的替换:

    if (typeof ie.lastIndex == 'undefined'){
    ie = false;}else{
    ie = attValue.match(/#\[^\}]*\}/);}
    if (!ie && attValue !== '') {attValues.push(attValue);}}}
    

    【讨论】:

      猜你喜欢
      • 2015-11-14
      • 1970-01-01
      • 1970-01-01
      • 2014-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-24
      • 2020-08-27
      相关资源
      最近更新 更多