Javascript objects


Ryan Sytsma
If I create Javascript in between the StartJS / EndJS actions -or- include an external JS file, are the objects visible in scope just by using ? How would I access the custom JS objects in AB actions and embedded JS? Thank you.

DecSoft

Hello Ryan,

Yes; the code between the StartJS and the EndJS actions is pure Javascript code. Take a look at this help tutorial about how to access AB controls and variables from pure Javascript code.



Ryan Sytsma
Yes, I looked at that. But, what about accessing JS objects from AB controls and actions?

DecSoft

Hello Ryan,

I am not sure if can understand... for that we have the StartJS and the EndJS actions: all the code inside that actions are considered Javascript code, so, we can use... Javascript code... to do whatever we need...



Ryan Sytsma
Right, but what if the JS code between the StartJS and the EndJS actions performs something that returns a value from an external JS file or similar, can I set that returned JS variable to an AB variable?

DecSoft

Hello Ryan,

That is (between other things) what you can see in the referred tutorial. If you need to assign a value to an AB variable from Javascript, you can use something like this:

Once that the "MyVariable" AB variable have the expected value.



Ryan Sytsma
Thank you. That helps.

DecSoft

No problem, Ryan!


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.