Articles Tutorials Work at Home Entrepreneurs, Webmasters, Small Business Owners
Articles Tutorials Work at Home Entrepreneurs, Webmasters, Small Business Owners
Articles & Tutorials for Work at Home Entrepreneurs
Webmasters and Small Business Owners
Get More >

Newest Articles 
Search Engine Marketing
Internet Marketing
Affiliate Marketing
Email Marketing
Viral Marketing
Webmaster Resources
Business Resources
Make More Money
CSS
Web Design
Graphic Design
Color Theory
Product Reviews
Time Management
Business Ethics
Promotional Strategies
Glossary of Terms
Direct Mail Marketing
Telemarketing
Product Sourcing



Link to Us!

Web Design
Email this article  :  Printer friendly page

The Advantages of Using External JavaScript

Can you imagine how fast search engine spiders could crawl and index your site if they had less code to wade through? Search engine spiders are looking for your page content, titles, alt tags, etc. They are not looking for those awesome graphics you designed.

They are also not concerned about your CSS or JavaScript, so make it easier on them and easier on your site visitors when your pages load faster by including your CSS and JavaScript in an external file.

The concept of External JavaScript is the same as External CSS. You simply link your .js files between the HEAD tags of your web pages and you only have one file to edit. This makes maintenance to your site a breeze!

For example, let's imagine that I have a file named ads.js which contains JavaScript code that rotates banner ads on all 500 pages of my site. If I link this file (as shown below) between the HEAD tags of all of my web pages, and each month I need to change these banner ads, I only have to change the banner ad references in one file. If I had the entire JavaScript code in each of my web pages, I would have to edit each of those 500 pages every month. Yikes! What a maintenance nightmare. The same concept is true with External CSS.

<script language="JavaScript" src="scripts/ads.js"></script>

If you have many .js files, put them their own directory (ie. "scripts", "js", etc.) to keep your web page elements organized as you should also do with your images.

Look at the code above. Replace the src="script/ads.js" with your own directory and .js file. To make this an absolute path, include your entire domain, ie. src="http://www.yoursite.com/scripts/ads.js"

Reference Article: "The Advantages of Using External CSS"

Copyright © 1994-2006 by BasicTips.com, a division of BasicTemplates.com, CSS HTML Web Site Templates with Exernal CSS and Removable Graphics. If you found our articles helpful, subscribe to our newsletter and get articles like this delivered to your inbox - FREE.

Order soon and get up to 5 FREE domains & more!
Host 6 Domains on 1 Account
5000MB and 400GB for $6.95 a month!

 

Page copy protected against web site content infringement by Copyscape
All articles are originally authored by BasicTemplates.com. Reprints in whole or in part are not permitted. See Copyright Notice

Copyright © 1994-2006 BasicTips.com, a division of BasicTemplates.com, Web Site Templates with External CSS
The Internet's #1 Choice for HTML CSS Web Templates via a Membership. Designed using External CSS and Removable, Swap-Out Graphics.
Basic Web Templates | Website Templates | HTML CSS Templates | Web Design Templates | Web Site Templates