Hello,

Synchronous loading of scripts can only be done using 
IE5,IE5.5 (and possibly in ie6). I've tried it with
NS4 by creating a layer and then writing the <script>
tag to it. It worked on my windows machine but I've
never tried it on other platforms.

The best thing to do is to use asynchronous loading.
this can be done with DynAPI2.9+

Check out this example:
http://www24.brinkster.com/dyntools/api/ibook

Or you could try using AfroAPI:
http://members.evolt.org/mpember/afroapix/website/

--
Raymond Irving

 
--- Marek Najmajer <[EMAIL PROTECTED]> wrote:
> 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


__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

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

Reply via email to