Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-09-2007, 08:11 PM   PM User | #1
probey20
New Coder

 
Join Date: Aug 2006
Location: Illinois
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
probey20 is an unknown quantity at this point
Question Best Way to Reference JavaScript Code?

What is the best way to reference JavaScript code, inline or external?

Normally we reference scripts in one external JS file, but in this case we have 6 different HTML files with 6 associated JS functions. Currently we are referencing all 6 functions in one external file. We were wanting to move each function within each HTML file, but we didn't know if it was best to have the script inline or in individual external script files.

Thoughts, opinions?
__________________
Sarah
probey20 is offline   Reply With Quote
Old 01-09-2007, 08:15 PM   PM User | #2
SpirtOfGrandeur
Regular Coder

 
Join Date: May 2005
Location: Michigan, USA
Posts: 566
Thanks: 0
Thanked 0 Times in 0 Posts
SpirtOfGrandeur is an unknown quantity at this point
You do it external so that the browsers can cache the page and js file independently of each other.
__________________
Note: I do not test code. I just write it off the top of my head. There might be bugs in it! But if any thing I gave you the overall theory of what you need to accomplish. Also there are plenty of other ways to accomplish this same thing. I just gave one example of it. Other ways might be faster and more efficient.
SpirtOfGrandeur is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 07:55 PM.


Advertisement
Log in to turn off these ads.