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
(Fri, May 9 00:59:12)

Google backs open source security team
Source: IOL
Date: May 9 2008 2:08AM

Google founders have grown up, CEO says
Source: Reuters
Date: May 9 2008 2:04AM

Google founders have grown up, CEO says
Source: IT News Australia
Date: May 9 2008 2:00AM

With Microsoft mum, analysts mull next moves for Live Search
Source: The Age
Date: May 9 2008 1:52AM

Google sees YouTube products soon; warm on Yahoo
Source: Globe Investor
Date: May 9 2008 1:51AM

Google execs hope for long-term ad deal with Yahoo
Source: The Age
Date: May 9 2008 1:49AM

Google execs hope for long-term ad deal with Yahoo
Source: Boston Globe
Date: May 9 2008 1:47AM

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

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