your ie-specific part is actually dom-code, but the ie-code 
will not work on ie4. try to write the <script> tags to the body, 
using document.body.insertAdjacentHTML() : 

else if (is.dom) {
        myscript.document.createElement('script');
        myscript.src=srclib;
        myscript.type='text/javascript';
        myscript.defer=true;
        document.getElementsByTagName('head')[0].appendChild(myscript);
}
else if (is.ie) {
        // ie4-part
        var code = '<scr'+'ipt type="text/javascript"
src="'+srclib+'"></scr'+'ipt>';
        document.body.insertAdjacentHTML('beforeEnd',code);
}


/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 20:44
> To: [EMAIL PROTECTED]
> Subject: Re: [Dynapi-Help] Dynamic loading of external code
> 
> 
> Thanks Martin,
> but I'd rather finish my work with 2.5.x line of DynAPI.
> I'm just looking for few lines of code for DOM browsers in the script:
> 
> function loadf(srclib,obj) {
>     var myscript;
>     if (is.ns4) location.href = srclib;
>     else if(is.dom) {
>             //THE DOM CODE SHOULD GO HERE
>             }
>     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);
> };
> 
> DynAPI 2.9 looks too complicated for me by now.
> I'll consider to upgrade after my project finish.
> 
> /marek najmajer
> 
> 
> ----- Original Message -----
> From: "martin ström" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, February 07, 2002 1:58 PM
> Subject: RE: [Dynapi-Help] Dynamic loading of external code
> 
> 
> 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
> 
> 
> _______________________________________________
> 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