Ho un JsFiddle here e aggiunto Microsoft AJAX da caricare tramite la sezione JS/risorsa esterna. Come posso sapere se il mio codice JS viene eseguito o meno dopo il caricamento del file AJAX?Come caricare un file esterno e assicurarmi che venga eseguito per primo in JSFiddle?
Sembra che anche AJAX non carichi. :(
Ecco il codice che 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);
Non potresti semplicemente incollare il codice MS dopo il tuo invece di usare l'opzione Aggiungi risorse? – j08691
Perché hai bisogno di farlo comunque? – j08691