Home | Toolshop | Guides | FAQ's | Inside | Contact Us Win Prizes!
Submit Corner Logo
Browse Submit Corner

Submit Corner : Guides : Bandwidth Guide : Make Your Javascript External

Toolshop

Assessment Tools
Keyword Thesaurus
Link Popularity Tracker
META Tag Generator
META Tag Scanner
Robot Generator
Submit Engine
Top Keywords
Word Tracker

Guides

META Tags
Description Tag
Keywords Tag
Revisit Tag
See Complete List

Search Engines
Google
Yahoo!
Overture
See Complete List

Site Improvement
Image Tags
Title Optimization
Effective META Tags
See Complete List

Software Packages
Web Position Gold
Submit Wolf
See Complete List

Website Assessment
Editor's Viewpoint of Directories
Assess Your Site Indexing
Who's Linking To You
Competitor Identification

Bandwidth Conservation
Background Images
External Javascript
Optimize HTML
See Complete List

FAQ

Our Recommendations
Read FAQ

Webposition Gold - Download Now!

Inside Submit Corner

Advertise
Author Guidelines
Contact Us
Linking Info
Privacy Policy
Rave Reviews
Terms of Use

Make Your Javascript External
By Submit Corner
Tell a Friend About This Page

Overview: Separate your Javascripts from your content and cut back on repeated code that occurs on your webpages.

One of the often-overlooked bandwidth savers can be achieved by caching any Javascripts and Cascading Style Sheets (CSS) that are repeated often on a web site. For example, most web designers will repeat the same Javascript/CSS code from page to page throughout a website. Designers can move commonly used functions, code and style sheets into an external file and refer to the file with one line from each page that requires it. This technique will enforce the external file to be cached and will only be retrieved once until the cache is emptied or expired.

HTML Code Before Making Javascripts External:
<HTML>
<HEAD><TITLE>Title Goes Here</TITLE></HEAD>
<script language="JavaScript">
function Sample() {...}
function Code() {...}
</script>
Continuation of HTML...

HTML Code After Making Javascripts External:
<HTML>
<HEAD><TITLE>Title Goes Here</TITLE></HEAD>
<script language="JavaScript" src="/functions.js"></script>
Continuation of HTML...

External Javascript Contents (functions.js):
Inside the external Javascript file, insert all functions, code and Cascading Style Sheets which you wish to be used globally throughout your website. Relating to the above example, you would insert the code for all functions used, to look something like this:
function Sample() {...}
function Code() {...}

Search Engine Advantage

Another advantage of outsourcing Javascript code to external files is the advantage provided for search engine indexing. Often, search engines that read your pages will mis-interpret your Javascript code as content and will index some of your code rather than useful content. Using this technique will not reveal to search engines your Javascript code and possibly improve your search engine rankings.

Sponsored Links



Win Great Prizes Just for Using Our Services

Latest Headlines

All links open in a new window
View All Headlines
(Sun, May 11 12:59:15)

Google Thinks of Web Security for Enterprises
Source: SDA Asia
Date: May 11 2008 12:48PM

Officials urged to probe any Google-Yahoo deal
Source: Shanghai Daily
Date: May 11 2008 12:39PM

Click Once to Search Faster with Yahoo Glue Pages
Source: SDA Asia
Date: May 11 2008 12:35PM

Does Your Copy Look "Fake" to the Search Engines?
Source: KTA Marketing
Date: May 11 2008 12:25PM

Sprint Nextel, Clearwire Form WiMax Group with Google
Source: Mobiledia
Date: May 11 2008 11:35AM

Google execs hope for long-term ad deal with Yahoo
Source: Findlaw Corporate Counsel
Date: May 11 2008 11:28AM

Google Shows Off Strategic Muscle
Source: NewsFactor Network
Date: May 11 2008 11:22AM

There are 23 additional news headlines. Click to View All Headlines

Copyright ©2000 - 2006 Wired 2000 Corporation
All Rights Reserved
Privacy | Terms of Use