[Javascript] Including Files

Tim Makins spindrift at oceanfree.net
Sat Nov 22 11:29:26 CST 2003


Thanks for the answer, Walter. I'll test it out, and will also bear in mind
David's warning about sub-directories.

Happy Tim in Ireland.

----- Original Message -----
From: "Walter Torres" <walter at torres.ws>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Saturday, November 22, 2003 3:36 PM
Subject: RE: [Javascript] Including Files


>
> > -----Original Message-----
> > From: javascript-bounces at LaTech.edu
> > [mailto:javascript-bounces at LaTech.edu]On Behalf Of Tim Makins
> > Sent: Saturday, November 22, 2003 9:08 AM
> > To: [JavaScript List]
> > 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...
>
> This is how I do it...
>
> Walter
>
> ========================================
>
>
>   var strIncludeFile  = './scripts/jsValidate.js';
>
> // Now include this file as well!
> includeFile ( strIncludeFile );
>
> // Generic INCLUDE statement that works across all the browsers!
> // Believe it or not!
> function includeFile ( strFilePath )
> {
>   var strIncludeCode  = '<script src="' + strFilePath + '"';
>       strIncludeCode += '  language="JavaScript"';
>       strIncludeCode += '  type="text/javascript">';
>       strIncludeCode += '</script>';
>
>     document.write ( strIncludeCode );
> }
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
>





More information about the Javascript mailing list