[Proto-Scripty] Re: how to load scripts dinamically

2008-10-16 Thread buda

look at ensure.js

On 16 окт, 20:22, SWilk [EMAIL PROTECTED] wrote:
 Hey,

 T.J. wrote a How-To on the wiki based on todays thread:

 http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynami...

 I just have one question regarding the how-to:

 quote
 Here's the dynamic.js file:

 scriptLoaded('dynamic');
 function coolFeature()
 {
      alert('Coolness!');}

 /quote

 Is it possible that the execution of this included script was paused
 after scriptLoaded() call, but before coolFeauture() is created?
 If so, it would be possible that the script already announced itself,
 but is not ready yet. Then I think the callback should be called after
 all the functions was created, on the bottom of the script.

 I do not know the javascript on such basic level so I might be wrong.

 --
 Regards,
 SWilk
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: how to load scripts dinamically

2008-10-16 Thread RobG



On Oct 17, 3:22 am, SWilk [EMAIL PROTECTED] wrote:
 Hey,

 T.J. wrote a How-To on the wiki based on todays thread:

 http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynami...

 I just have one question regarding the how-to:

 quote
 Here's the dynamic.js file:

 scriptLoaded('dynamic');
 function coolFeature()
 {
      alert('Coolness!');}

 /quote

 Is it possible that the execution of this included script was paused
 after scriptLoaded() call, but before coolFeauture() is created?

The ECMAScript Spec, section 14 Program says:

|  The production Program : SourceElements is evaluated as follows:
|  1. Process SourceElements for function declarations.
|  2. Evaluate SourceElements.
|  3. Return Result(2).

In other words, all the script is read, then execution begins.  You
may have issues if the function is defined in a script that is loaded
after a script that calls it.


--
Rob
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---