Can someone tell me what's wrong with this http://jsfiddle.net/Yp8Bz/? It works fine in Chrome/Firefox, but in IE 8 I get the following error:
Message: Unable to parse bindings. Message: SyntaxError: Expected identifier, string or number; Bindings value: click: blah, attr: {class: 'Hi'} Line: 38 Char: 359 Code: 0 URI: http://cdnjs.cloudflare.com/ajax/libs/knockout/2.0.0/knockout-min.js
Knockout's declarative binding system provides a concise and powerful way to link data to the UI. It's generally easy and obvious to bind to simple data properties or to use a single binding.
Text binding causes the associated DOM element to display the text value of the parameter. This is used in text-level DOM elements such as <span> or <em>. The text binding accepts any data type and parses it into String before rendering it.
KO is able to create a two-way binding if you use value to link a form element to an Observable property, so that the changes between them are exchanged among them. If you refer a simple property on ViewModel, KO will set the form element's initial state to property value.
Put class
in quotes. I ran into the same issue when using a reserved word.
attr: {'class': 'Hi'}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With