check out Dan's scriptlibrary-loader in the 2.9 version:

http://makeashorterlink.com/?J5D22236

just use dynapi.library.loadScript("script.js") to load the scripts.

i think there is a 2.9.1 version coming out pretty soon, maybe the
library-loader also will be improved.

/martin

____________________________________

harald martin ström
www.burnfield.com www.pluxemburg.com 

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]] On Behalf Of
> Marek Najmajer
> Sent: den 7 februari 2002 13:22
> To: [EMAIL PROTECTED]
> Subject: [Dynapi-Help] Dynamic loading of external code
>
>
> Hi all,
> I've prepared a script to add and launch functions from an
> external JS file
> in synchronous manner.
> It's launched from an anchor on the page. (it's basing on
> some code from
> dynapi-dev list.)
> It works in IE5,IE5.5 very good.
> In NS4.7 it works once and crash sometimes when launched again.
> In NS6 nothing happens while in IE6 generates an error.
> Any ideas how to add DOM support and NS4.7 stability...
>
> //loading external scripts
> function loadf(srclib,obj) {
>     var myscript;
>     if (is.ns4) location.href = srclib;
>     else if (is.ie) {
>                 myscript=document.createElement('script');
>                 myscript.src=srclib;
>                 myscript.type='text/javascript';
>                 myscript.defer=true;
>   document.getElementsByTagName('head')[0].appendChild(myscript);
>  }
>     launch(obj);
> };
> function launch(obj) {
>  if (!window[obj]) {
>   status='Loading an external file...';
>   setTimeout("launch('"+obj+"')",20);
>  }  else {
>   ldata(); //function added from a loaded external file
>   var tcl = new MyWidget();
>   DynAPI.document.addChild(tcl);
>   status='External file completely loaded.';
>  }
> };
>
> /mark najmajer
>
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dynapi-help
> 


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to