在IE8中敲除了属性绑定的js [英] Knockout js for attribute binding in IE8

查看:173
本文介绍了在IE8中敲除了属性绑定的js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法绑定IE8中的属性

Can't bind for attribute in IE8

http: //jsfiddle.net/k2Mq7/ - ko 2.1:

http://jsfiddle.net/k2Mq7/ - ko 2.1:

SCRIPT5022: Unable to parse bindings.
Message: SyntaxError: Expected identifier, string or number;
Bindings value: attr: { id: 'that-works', for: 'but-than-not' } 

http://jsfiddle.net/k2Mq7/3/ - ko 2.1引用('for'):

http://jsfiddle.net/k2Mq7/3/ - ko 2.1 quoted for ('for'):

jsfiddle失败但在我的本地机器上没有任何错误,但是这个标签没有显示属性。

jsfiddle fails but on my local machine no any errors but this label displayed without for attribute.

它是Knockoutjs错误还是我做错了什么?

Is it Knockoutjs bug or that I am doing something wrong?

推荐答案

对属性名称使用引号这个:

Use quotation marks for attributes names like this:

<label data-bind="attr: { 'for': vmProperty }"></label>

这篇关于在IE8中敲除了属性绑定的js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆