When I pass \'this\' to an anonymous function like so:
MyClass.prototype.trigger = function(){ window.setTimeout(function(){this.onTimeout();},1000); }
you will have the same problem if inside your new method: newRequest you have to use a "for" or a "while" statement. Another solution could be creating a closure:
like that:
$.getJSON("answer.html",{},(function(me){return function(data){me.gotAnswer(count);}})(this));