Can't get knockout running
javascript, knockout.js
Solution
Wrap you knockout code in `$( document ).ready( function() {} );`
$( document ).ready( function() {
function AppViewModel() {
this.firstName = "Bert";
this.lastName = "Bertington";
}
ko.applyBindings(new AppViewModel());
} );
And don't forget to include jquery itself.
Problem
I'm a complete noob in knockoutjs and I'm facing a problem just from the beginning. I have done everything described in the installation guide, but I can't get it working. My HTML: ``` <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <script type='text/javascript' src='js/knockout-3.0.0.js'></script> <script type='text/javascript' src='js/myTasks.js'></script> <TITLE>Your Tasks</TITLE> </HEAD> <BODY> <p>First name: <strong data-bind="text: firstName"></strong></p> <p>Last name: <strong data-bind="text: lastName"></strong></p> </BODY> </HTML> ``` My viewmodel - contained in the `myTasks.js` file: ``` function AppViewModel() { this.firstName = "Bert"; this.lastName = "Bertington"; } ko.applyBindings(new AppViewModel()); ``` What I'm getting is: ``` First name: Last name: ``` The above code is the code used in the first knockoutjs tutorial. Why I can't run it? I know that I'm missin something really small, but I'm not able to spot it.