I've create a 'Page Class' and an associated 'load' method.
The loading works perfectly, but i can't modify a property of that page within the callback method, although I cant reference the page name property !!!
function Page(page) {
this.page = page;
this.firstLoad = true;
this.pageName = this.page.split('.')[0].split('/')[1];
this.loaded = false;
}
Page.prototype.load = function () {
var that = this;
$("#content").html();
$("#content").load(this.page, function () {
$.getScript("PagesViewModel/" + that.pageName + "ViewModel.js");
that.loaded = true;
});
}
this.loaded is always false !!!
Thank you for your help
Regards