running script with onload
Posted: Sat Jul 30, 2011 1:05 am
I have a script that I load in the external javascript attribute of a screen. It has one function named setVisible.
I would like to call this script as soon as the screen is loaded so I tried the onload event for the screen, but that seems to be triggered before the external javascript is fetched which means that I get an onload error: setVisible is not defined
Is it possible to call a script at onready time (after the external script is loaded) rather than at onload time (before the external script is loaded) ?
I know it will work at onload time if I have it saved load it into custom/js directory, but that means the script is sent to every program that get's run, even though it is only required/run in one program.
thanks & regards
Tony C
I would like to call this script as soon as the screen is loaded so I tried the onload event for the screen, but that seems to be triggered before the external javascript is fetched which means that I get an onload error: setVisible is not defined
Is it possible to call a script at onready time (after the external script is loaded) rather than at onload time (before the external script is loaded) ?
I know it will work at onload time if I have it saved load it into custom/js directory, but that means the script is sent to every program that get's run, even though it is only required/run in one program.
thanks & regards
Tony C