[Chameleon] Diference: GetJavascriptInitFunctions vs GetJavascriptOnLoadFunctions

William Bronsema wbronsema at dmsolutions.ca
Sat Jan 12 10:57:02 EST 2008


Hi Alexys,

 

The GetJavascriptOnloadFunctions function lets you define what javascript functions should be run after the page is fully loaded.  

 

For instance if you need to run javascript that interacts with a textbox on the page, the textbox has to be drawn by the browser before javascript can interact with it.  You need to run the javascript after the pasge has fully loaded, so you would use the GetJavascriptOnloadFuntions function.

 

The GetJavascriptInitFunctions define the javascript functions that will run as soon as the page starts loading.  These are the very first bits of javascript that will get run so it is a good place to initialize default values etc.  You cannot count on elements being loaded when this code is run.

 

Does that make sense?

 

In the case of the UUW using the Onload versus the report widget using the Init, it is actually doesn’t matter which one was used in that case.  Loading the popup window did not depend on reading elements in the page, so it did not have to be in the Onload functions, it was the developer’s choice to put it there.

 

Cheers,

Bill

 

 

William Bronsema

Senior Applications Specialist

DM Solutions Group Inc.

 

___________________________________

http://www.dmsolutions.ca

 

 

 

From: chameleon-bounces at lists.maptools.org [mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Alexys Herleym Rodriguez Avellaneda
Sent: Saturday, January 12, 2008 10:24 AM
To: chameleon
Subject: [Chameleon] Diference: GetJavascriptInitFunctions vs GetJavascriptOnLoadFunctions

 

Hi:

 

I need to know what is the diference between GetJavascriptInitFunctions and GetJavascriptOnLoadFunctions. 

 

When i use one or other?

 

In the sample widget UUW, they use GetJavascriptOnLoadFunctions to show the load the javascript funtion to show the report:

$aReturn['showReport'] = “showReport();\n”;

 

but in the querybyshape widget they use GetJavascriptInitFunctions to load the function to show the popup:

$aResult['QueryFedeganWShowPopup'] = "QueryFedeganWShowPopup();\n";

 

Can somebody tellme what is the difference. When i use one or other?

 

Thanks in advance.

 

Alexys H

 

  _____  


Web Revelación Yahoo! 2007:
Premio Favorita del Público - ¡Vota tu <http://es.promotions.yahoo.com/revelacion2007/favoritos/>  preferida!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20080112/c2c365a6/attachment.html


More information about the Chameleon mailing list