【发布时间】:2012-02-06 03:16:57
【问题描述】:
我有一个 JsFiddle here,并添加了要通过外部 JS/资源部分加载的 Microsoft AJAX。在 AJAX 文件加载完成后如何判断我的 JS 代码是否运行?
似乎 AJAX 也没有加载。 :(
这是JSFiddle中的代码:
Type.registerNamespace("Tutorial.Chapter1");
Tutorial.Chapter1.Person = function(firstName, lastName) {
this._firstName = firstName;
this._lastName = lastName;
};
Tutorial.Chapter1.Person.prototype = {
set_firstName: function(value) {
this._firstName = value;
},
get_firstName: function() {
return this._firstName;
},
set_lastName: function(value) {
this._lastName = value;
},
get_lastName: function() {
return this._lastName;
},
_firstName: "",
_lastName: "",
displayName: function() {
alert("Hi! " + this._firstName + " " + this._lastName);
}
};
Tutorial.Chapter1.Person.registerClass("Tutorial.Chapter1.Person", null);
【问题讨论】:
-
你不能直接粘贴 MS 代码而不是使用“添加资源”选项吗?
-
为什么还需要这样做?
标签: javascript asp.net-ajax jsfiddle