I use the below code to write code to query a web method in a specified interval.
now in the this.Poll function I have to do
this.tmo = setTimeo
Loose the parenthesis in this.Poll()
. You call this function right away, not after a time interval. If you loose the brackets, it will pass a function, not a result of it, to setInterval
and you won't have any issues.
setTimeout(this.Poll, this.Interval);
Otherwise you call the function right away and nothing holds this
pointer anymore, and IE just deletes it.
In fixed variant, this.Poll
will hold pointer to this
and it won't be deleted.