Hi,
I've just had a play with Knockout.js and on first glance it seems it could be useful.
However, walking through their online tutorial, it seems the plug-in requires you to add invalid attributes to HTML tags, not only for binding the modelview to the view, but also for onclick events?
I was under the impression that even using the onclick event attribute (and others) was considered bad practice and events should now be bound from JavaScript (such as JQuery) and not hard coded into tag attributes.
So if using semantic valid tag attributes to bind JavaScript functions to events is considered bad practice and not the correct way of doing things how can the following be acceptable?
Does this mean anyone who uses Knockout.js doesn't care about standards or semantics, or is the tutorial just showing the bare bone basics and this is covered somewhere else in the documentation?
Anyone have any experience with this?
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
I've just had a play with Knockout.js and on first glance it seems it could be useful.
However, walking through their online tutorial, it seems the plug-in requires you to add invalid attributes to HTML tags, not only for binding the modelview to the view, but also for onclick events?
I was under the impression that even using the onclick event attribute (and others) was considered bad practice and events should now be bound from JavaScript (such as JQuery) and not hard coded into tag attributes.
So if using semantic valid tag attributes to bind JavaScript functions to events is considered bad practice and not the correct way of doing things how can the following be acceptable?
Code:
<button data-bind="click: capitalizeLastName">Click Me</button>
Does this mean anyone who uses Knockout.js doesn't care about standards or semantics, or is the tutorial just showing the bare bone basics and this is covered somewhere else in the documentation?
Anyone have any experience with this?
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music