Page 1 of 1

Manual executing of service

Posted: Sun Apr 28, 2013 12:35 pm
by Michael Pierce

Is there a way to set the amount of time before you execute a service manually with the code service_name.execute({}); I basically want something to display on my page for about 4 seconds before the service executes which results in a page change on success. I'm using this same service in another area as well so I don't want to mess with the success event I already have setup.


Manual executing of service

Posted: Sun Apr 28, 2013 12:43 pm
by Igor

Hello.

This should help: http://api.jquery.com/delay/


Manual executing of service

Posted: Sun Apr 28, 2013 12:45 pm
by dale

Hi,

I've seen this code for creating a splash screen and then navigating to a page:

setTimeout(function() {navigateTo ('screen_name');},3000);

Maybe you could put the execute in place of the navigateTo?

I'm very much a beginner, so not sure, just trying to help. ;-)

Dale.


Manual executing of service

Posted: Sun Apr 28, 2013 12:53 pm
by Michael Pierce

thanks guys but I tried your method Dale and it didn't work also Igor I tried this line: service_name.execute({}).delay(4000); and it did not work either. Am I writing the code wrong?


Manual executing of service

Posted: Sun Apr 28, 2013 2:01 pm
by Igor

Please Try to use next code:
code
function execServ () {
service_name.execute({});
}
setTimeout(execServ, 4000);
/code