【问题标题】:How to get html5 and knockout support in mvc3如何在 mvc3 中获得 html5 和淘汰赛支持
【发布时间】:2013-02-25 10:13:24
【问题描述】:

我创建了一个 mvc3 项目,但没有选中 HTML 标记语义支持复选框。现在我正在尝试在我的项目中使用淘汰赛 js。由于淘汰赛仅适用于 html5,因此我从 Visual Studio 中选择了 html5 调试模式。但是 ko.applyBinding 不起作用。请帮助..

【问题讨论】:

  • 贴出代码,问题好像出在别的地方
  • 你能把你的完整代码加进去吗

标签: asp.net-mvc-3 html knockout.js


【解决方案1】:

可能你的问题是绑定ko。

尝试为特定的 div id 绑定您的 viewModel,如下面的代码。它可能会解决您的问题

HTML

<div id="container_id">
...
<div>

脚本:-

ko.applyBindings(new AppViewModel(), document.getElementById('container_id'));

【讨论】:

    【解决方案2】:
    For HTML 5 you need to change your HTML structure like below way.
    
    <!DOCTYPE html>
    <html>
    <head>
    </head>
    <body>
    // Body content will come here.
    </body>
    </html>
    

    【讨论】:

      猜你喜欢
      • 2014-09-29
      • 2012-04-08
      • 2015-06-23
      • 2011-08-08
      • 2014-03-17
      • 2015-06-02
      • 2016-05-11
      • 2014-08-21
      • 1970-01-01
      相关资源
      最近更新 更多