was hoping you could help me out.
I'm trying to figure out a way to change javascript code using javascript.
If thats not possible, then if you could suggest another way for me to accomplish what i'm trying to do it would be great.
Basically, a user selects option, which generates a customized javascript code for a clock (using php via ajax techniques). now this code is run using the eval statement, and the clock is displayed in a particular element.
the eval() statement is run each time a response is received from server via AJAX.
Problem is, since it is a clock, I have used setInterval() to constantly update the time. Now if multiple ajax calls are run, multiple functions start to run in a loop.
i.e, after first server call we have this running:
setInterval(function and code for clock with format 1,1000);
AND
setInterval(function and code for clock with format 2,1000);
so basically, I want to somehow stop the first one from running before the second one starts..any ideas?
thanks in advance.