【问题标题】:knockout.js 1.3 and jquery templates 1.0pre issue in IE8IE8 中的 knockout.js 1.3 和 jquery 模板 1.0pre 问题
【发布时间】:2011-10-21 19:35:12
【问题描述】:

我在使用 IE8 以及最新版本(测试版)的 knockout.js 和 jquery 模板时遇到了一个重大问题。我不断收到以下错误。如果我在trialogueRun 中删除<div>,那么它不会出错。它发生在 jquery.tmpl.js 中的 buildTmplFn(markup) 函数中。

SCRIPT1028: Expected identifier, string or number 
jquery.tmpl.js, line 317 character 9


<script id="trialogueRun" type="text/html">
        <div data-bind="attr: { class: $data.AgentName }"></div>
</script>

【问题讨论】:

    标签: internet-explorer-8 knockout.js jquery-templates


    【解决方案1】:

    让它与 IE8 一起工作。我应该知道 IE 会遇到“类”这个词的问题。

    <div data-bind="attr: { 'class': $data.AgentName }"></div>
    

    【讨论】:

    • 我在 knockout.js v1.2.1 第 928 行中遇到了类似的错误,一直在寻找年龄,这为我解决了问题。
    • 我在 knockout.js 2.0.0 中遇到了类似的问题,这为我解决了问题。干得好!
    猜你喜欢
    • 1970-01-01
    • 2013-01-10
    • 2011-10-24
    • 2011-10-24
    • 2011-05-23
    • 1970-01-01
    • 1970-01-01
    • 2012-06-30
    • 2014-11-24
    相关资源
    最近更新 更多