I understand how the tutorial works on the page, but I'm trying to set one up locally to create a calculator and can't get knockout.js to work. It doesn't initialize or populate like the knockout.js online tutorial.
HTML
<html>
<head>
<script type="text/javascript" language="javascript" src="../knockout-2.1.0.js"></script>
<script type="text/JavaScript" language="javascript">
function AppViewModel() {
this.firstName = ko.observable("Bert");
this.lastName = ko.observable("Bertington");
}
// Activates knockout.js
ko.applyBindings(new AppViewModel());
</script>
</head>
<body class="calc" onLoad="createnav()">
<div id="all">
<div id="calc">
<p>First name: <strong data-bind="text: firstName"></strong></p>
<p>Last name: <strong data-bind="text: lastName"></strong></p>
<p>First name: <input data-bind="value: firstName" /></p>
<p>Last name: <input data-bind="value: lastName" /></p>
</div>
<div id="info">
<!-- outputs will be here -->
</div>
</div>
</body>
</html>
I'm using knockout.js version 2.1.0. As for location of the src
it is correct.
Folder Structure
----------
| Root |
----------_____________________
| |
------------------- ------------ ---------------
| knockout-2.1.0.js | | pphcalc | ___ | HeroPilot.asp |
------------------- ------------ ---------------
Any suggestions?