【发布时间】:2012-09-17 13:53:55
【问题描述】:
我是使用 knockout2.1.0 进行淘汰赛的新手。 我有一个外部 java 脚本文件,但在我的 html 文件中没有调用它。看不懂。
我在我的 html 文件中添加了以下内容
<script src="Scripts/TestJavascript.js"></script>
JS 文件
///<reference path="~/Scripts/jquery-1.8.1.min.js">
///<reference path="~/Scripts/knockout-2.1.0.debug.js">
$(function AppViewModel() {
this.firstName = ko.observable("rash");
this.lastName = ko.observable("Bertington");
this.fullName = ko.computed(function(){
return this.firstName() + " " + this.lastName();
}, this);
})
ko.applyBindings(new AppViewModel());
谢谢。
【问题讨论】:
-
我的意思不是要让人觉得很苛刻,但你的问题很令人困惑..你能提供一些更相关的代码吗?
标签: javascript html knockout.js knockout-2.0