I got this piece of script (runned locally):
You need to remove the ()
after uploadnew
within the setInterval call:
setInterval (uploadnew, 1000*60*5);
In JavaScript, functions are first-class objects which can be passed to other functions. In this example, you want to pass the function itself to setInterval, not call it first and then pass its return value.
Using setInterval ("uploadnew()", 1000*60*5);
is not recommended because it is a "hidden" form of eval. Eval is evil and you shouldn't use it if you don't have to.