[Javascript] Including Files

Walter Torres walter at torres.ws
Sat Nov 22 22:33:45 CST 2003


Thanks for the heads up on this Dave.

Never thought to do that, nor check it.

Just did, and your right, can not backtrack, but current and sub-directory
paths work fine.

But also note, the path is relative to the calling HTML file, *not* the
"master" js file!

Thanks

Walter


> -----Original Message-----
> From: javascript-bounces at LaTech.edu
> [mailto:javascript-bounces at LaTech.edu]On Behalf Of David Lovering
> Sent: Saturday, November 22, 2003 10:01 AM
> To: [JavaScript List]
> Subject: Re: [Javascript] Including Files
>
>
> Yes, but with caveats.
>
> Because most of the implementations of JavaScript that I'm familiar with
> don't let you backtrack directories (via the
> SRC="../../my_page.js" method),
> you generally find it more convenient to put your primary script
> at the top
> of a descending directory tree, and your "custom" stuff in descending
> directories beneath it.  For example,
>
> SRC="./subdirA/myPage.js" generally works on most versions.  In
> cases where
> it doesn't, you can often create a directory alias which will do the job.
> This is part of the OS feature set, and has next to nothing to do with
> JavaScript per se.
>
> Hope that helps a little bit.
>
> -- Dave Lovering
>
> ----- Original Message -----
> From: "Tim Makins" <spindrift at oceanfree.net>
> To: "[JavaScript List]" <javascript at LaTech.edu>
> Sent: Saturday, November 22, 2003 8:07 AM
> Subject: [Javascript] Including Files
>
>
> > <SCRIPT SRC="my_page.js"></SCRIPT>
> >
> > The above line lets me include an external script in my page.
> >
> > I have two questions about this...
> >
> > A/ If I had three folders: 'folder_A, folder_B, folder_C' each of which
> > contain the file 'my_page.js', is there any way a script could specify
> which
> > one of those folders to load 'my_page.js' from?
> >
> > B/ Similarly, if I had 1 folder, and in it were 3 files: 'my_page1.js,
> > my_page2.js, my_page3.js', is there any way a script could specify which
> one
> > of those files to load?
> >
> > Tim in Ireland.
> >
> > PS in case someone (there usually is someone) asks why I want
> to do this,
> > the answer is that I have a large amount of data, and rather than trying
> to
> > load it all in one go, it makes more sense to split it up and
> get the data
> > as required. This is for a local display on a static machine
> reading from
> CD
> > or harddrive, so no servers, ASP, PHP, databases, etc. are involved.
> >
> >
> >
> >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > https://lists.LaTech.edu/mailman/listinfo/javascript
> >
> >
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list