John5269257
Posts: 0
Joined: Mon Jun 17, 2013 11:04 am

execute a service, where servicename is a variable

Hi

I'm executing a service from javascript. This works:
startScreenQR.execute();

But I need to do something like this:
var myService = "startScreenQR";
myService.execute();

This obviously doesn't work, and I get this:

Uncaught TypeError: Object startScreenQR has no method 'execute'

Is there a way of passing the service name as a variable?

Thanks
John

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

execute a service, where servicename is a variable

Hello!
Use prewindow[myService].execute();/pre

Return to “Issues”