Tried to fiddle with knockoutjs for the first time, but can’t get any examples to work:
What’s wrong with this html page – it only displays “first name:” / “last name:” in my browser:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head runat="server">
<title>Knockout demo</title>
<script src="Scripts/knockout-2.0.0.js" type="text/javascript"></script>
<script type="text/javascript">
function AppViewModel() {
this.firstName = "Helena";
this.lastName = "Christensen";
}
ko.applyBindings(new AppViewModel());
</script>
</head>
<body>
<div>
<p>First name: <strong data-bind="text: firstName"></strong></p>
<p>Last name: <strong data-bind="text: lastName"></strong></p>
</div>
</body>
</html>
The following will work: