hi. i have a problem and was hoping someone could help.
sorry for my english and all the norwegian words in my code
i have a project where i have to do an ajax call for som json.
i have to print out the response and it works the first time, but
when it is supposed to check a second time the context has
changed and this isnt this anymore.
anyone know how i can fix it without using more global variables or
functions??
[CODE]
function medlemslisteobjekt() {
this.medlemsliste = new Array();
this.loggId = -1;
this.t;
this.xmlHttp;
}
var objekt = new medlemslisteobjekt();
medlemslisteobjekt.prototype.stopTimer = function() {
//alert(“stoptimer”);
clearTimeout(this.t);
};
medlemslisteobjekt.prototype.startTimer = function() {
//alert(“starttimer”);
this.t = setTimeout(“objekt.ajaxHentEndringer”, 1000);
};
medlemslisteobjekt.prototype.handleServerResponse = function() {
//alert(“handleserverresp”);
if (this.xmlHttp&&this.xmlHttp.readyState == 4) {
if (this.xmlHttp.status == 200) {
this.startTimer();
var response = JSON.parse(this.xmlHttp.responseText.split(“,”));
i know i havnt given you alot of code but the whole thing is 200 lines
thanks for any response