John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

run a service every minute??

hi, i want to run a gps service every 5 minutes once the service is invoked by a button i created. So, i have made 2 local storage items (one for the longitude ('long') and one for latitude ('lat') to map to. Then i want to run a JS to run the gps service every 5 minutes to update on its own the local storage items, then Im gonna have another REST service to send back those parameters to the server. So i need to run a JS on that service too - the service to be invoked every 5 mins. WHat would the JS code look like for these functions?

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

run a service every minute??

what does '5000' mean in this code?

setTimeout( "restdatasource01.execute({})" , 5000);

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

run a service every minute??

Time, in milliseconds. setTimeout(..) is a standard JavaScript method. You can find more information about it online.

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

run a service every minute??

so, then if i want to run this service every 5 minutes it would be like this:

setTimeout( "restdatasource01.execute({})" , 300000);

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

run a service every minute??

as in 300,000 miliseconds (which should equal 5 minutes since theres 300 seconds in 5 minutes)

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

run a service every minute??

Hi John - yes you right. This link can help with time conversion :: http://www.unitconversion.org//unit_c...

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

run a service every minute??

Hi I was trying to avoid getting the progressbar to keep showing up every 30 seconds (in this case), so I ran this code:

setTimeout( "geolocation1.execute({})" , 30000);
$('#ajaxBusy').remove();

Its ok if the progress bar shows up the first time the button is clicked, but after the service is invoked (by a button) , I dont want the progressbar to appear any longer... But the above code doesnt seem to work... Is there another way to do this or is the JS wrong?

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

run a service every minute??

I even ran just this JS on page load, and the progressbar still appeared. Am I missing something here?:

$('#ajaxBusy').remove();

Return to “Issues”