Yea, what I'm trying to do is load an external JS file after the page is rendered, so it doesn't wait to load it before the page is displayed to the user. This JS file will write out some sponsored links from another service, and I don't want my page to wait to render while it's pulling this other JS file.
-Matt On Fri, 18 Mar 2005, Bj wrote: > You can't include a chunk of JS from a separate file into the middle of a JS > script. You can have a script whose entire contents are included from a > separate file in your page by putting <script language="JavaScript" > src="foo.js"></script> in the document, and all the JS in a separate file > called foo.js. > > However, if you can use ASP or php in your page, then you can easily include > chunks of JS into the script on your page by using SSI or php includes, e.g. > > <script language="JavaScript"> > <!-- > <?php include "chunk1.js";?> > some more JS > <?php include "chunk2.js";?> > //--> > </script> > > HTH > ----- Original Message ----- > From: "Matt C." <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Friday, March 18, 2005 8:24 PM > Subject: [wdvltalk] Include a JS file from another JS file? > > > > Anyone know how to include a JS file from another JS file via javascript? > > I've tried doing a document write of the script tag stuff, but it doesn't > seem to > > work very well. Is there some mystical "import" function I don't know > > about? > > > > -Matt > > > > > > > > ____ . The WDVL Discussion List from WDVL.COM . ____ > > To Join wdvltalk, Send An Email To: > mailto:[EMAIL PROTECTED] or > > use the web interface > http://e-newsletters.internet.com/discussionlists.html/ > > Send Your Posts To: [email protected] > > To change subscription settings, add a password or view the web interface: > > http://intm-dl.sparklist.com/read/?forum=wdvltalk > > > > ________________ http://www.wdvl.com _______________________ > > > > You are currently subscribed to wdvltalk as: [EMAIL PROTECTED] > > To unsubscribe send a blank email to [EMAIL PROTECTED] > > To unsubscribe via postal mail, please contact us at: > > Jupitermedia Corp. > > Attn: Discussion List Management > > 475 Park Avenue South > > New York, NY 10016 > > > > Please include the email address which you have been contacted with. > > > ____ � The WDVL Discussion List from WDVL.COM � ____ > To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or > use the web interface http://e-newsletters.internet.com/discussionlists.html/ > Send Your Posts To: [email protected] > To change subscription settings, add a password or view the web interface: > http://intm-dl.sparklist.com/read/?forum=wdvltalk > > ________________ http://www.wdvl.com _______________________ > > You are currently subscribed to wdvltalk as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > To unsubscribe via postal mail, please contact us at: > Jupitermedia Corp. > Attn: Discussion List Management > 475 Park Avenue South > New York, NY 10016 > > Please include the email address which you have been contacted with. > ____ � The WDVL Discussion List from WDVL.COM � ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or use the web interface http://e-newsletters.internet.com/discussionlists.html/ Send Your Posts To: [email protected] To change subscription settings, add a password or view the web interface: http://intm-dl.sparklist.com/read/?forum=wdvltalk ________________ http://www.wdvl.com _______________________ You are currently subscribed to wdvltalk as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] To unsubscribe via postal mail, please contact us at: Jupitermedia Corp. Attn: Discussion List Management 475 Park Avenue South New York, NY 10016 Please include the email address which you have been contacted with.
