Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
How do I include a Javascript file in a Javascript file?
Old 08-10-2009, 08:06 PM How do I include a Javascript file in a Javascript file?
Banned

Posts: 7
Trades: 0
I am looking to nest an include for one javascript file in another, how do I do this?
ProMaster is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-10-2009, 08:08 PM Re: How do I include a Javascript file in a Javascript file?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
you don't.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-10-2009, 11:56 PM Re: How do I include a Javascript file in a Javascript file?
freeloader's Avatar
Experienced Talker

Posts: 35
Trades: 0
Code:
document.write('<script src="script2.js"></script>');
?
__________________
"It is a profitable thing, if one is wise, to seem foolish." --Aeschylus

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Last edited by freeloader; 08-10-2009 at 11:57 PM..
freeloader is offline
Reply With Quote
View Public Profile
 
Old 08-11-2009, 08:16 AM Re: How do I include a Javascript file in a Javascript file?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
or, in a more "programming" way of doing:
Code:
js=document.createElement('script')
js.type="text/javascript"
js.src="http://whatever.com/included.js"
document.getElementsByTagName['body'][0].appendChild(js)
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to How do I include a Javascript file in a Javascript file?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.35257 seconds with 12 queries