Hmm, I doubt that that works as wanted (but hey, I'm not sure what is wanted
:). The scripts you include by document.write inside your js file gets
loaded only after the original js file has been loaded. (At least there is
no guarantees that the included files would be loaded before the original.)
So if you wan't to use java style including in the beginning of your js
files, it will fail (in ie5.5 at least). I think the only way to get that
kind of easy including to work is to maintain some table of references in a
js file that you will load in every case. That file then writes the
necessary info to the document. Those included stuff can be used only after
everything has been included, i.e for example inside the onload function.
I might be wrong, and actually I'd be very glad to be wrong, since I would
like very much to use java style including in js...
Tuomas
> Actually it still works if I call js1.js from the page:
> <SCRIPT language="JavaScript" src="js1.js"></SCRIPT>
>
> and call js2.js from js1.js:
> document.write('<SCRIPT language="JavaScript" src="js2.js"><\/SCRIPT>')
>
> and heart.js from js2.js:
> document.write('<SCRIPT language="JavaScript" src="heart.js"><\/SCRIPT>')
>
> I would imagine it would work in infinite number of times.
>
> It has to be something else.
>
> Glen Deas
>
> ----- Original Message -----
> From: "Jonah" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, July 18, 2001 4:25 PM
> Subject: RE: [Dynapi-Help] loading external js files
>
>
> > wierd. this actually works fine in my ie 5.5. my problem may have arose
> > from trying similar code from within another js file. I wonder why that
> > would make a difference?
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Glen Deas
> > Sent: Thursday, July 19, 2001 2:04 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [Dynapi-Help] loading external js files
> >
> >
> > I only have ie 5.5. Is this not working in other ie browsers?
> > http://www.sandymermaid.com/jstest.html
> >
> >
> > ----- Original Message -----
> > From: "Stephan Tolksdorf" <[EMAIL PROTECTED]>
> > To: "Jonah" <[EMAIL PROTECTED]>
> > Sent: Wednesday, July 18, 2001 2:21 AM
> > Subject: Re: [Dynapi-Help] loading external js files
> >
> >
> > > > am having a problem loading external js files in ie using
> > document.write()
> > > > the following code works fine in netscape however, and as
> far as i can
> > tell
> > > > is the same code used by DynAPI.include():
> > > >
> > > > document.write('<SCRIPT language="Javascript1.2"
> > > > src="externalJsFile.js"><\/SCRIPT>')
> > >
> > > I don't know the context of that line, but here is my wild guess:
> > >
> > > In the Netscape implementation, version 1.2 of the language differs
> > > in some noticeable ways from all other Netscape versions.
> > > You should NOT use "Javascript1.2" for loading external scripts, it is
> > > a relict of times where you had to prevent Netscape 3 from loading a
> > > script...
> > >
> > > For some interesting details look at:
> > > http://bugzilla.mozilla.org/show_bug.cgi?id=86166
> > >
> > > Stephan
> > >
> > >
> > > _______________________________________________
> > > Dynapi-Help mailing list
> > > [EMAIL PROTECTED]
> > > http://lists.sourceforge.net/lists/listinfo/dynapi-help
> >
> >
> > _______________________________________________
> > Dynapi-Help mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/dynapi-help
> >
> >
> > _______________________________________________
> > Dynapi-Help mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/dynapi-help
>
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help