External JavaScript
January 31, 2006When doing search engine optimisation work, I often see index pages with vast amounts of JavaScript in. This is completely unnecessary, as it can be pulled in from external files which can greatly reduce the file size of web pages, causing them to load faster and be more search engine friendly. In fact, this is just one of many advantages, which is why I am surprised I don’t see separate JavaScript files more often.
Creating a separate JavaScript file is very similar to creating an external CSS file. Simply make a new JavaScript file with whatever name you like (such as ‘example.js’?). Then place your existing JavaScript into this file and replace it with a link to the file with the following format: <script type="text/javascript" src="example.js"></script>.
Using external JavaScript makes site creation and maintenance a lot easier and is often used for this reason. For example, someone who wants to use the same JavaScript banner on every page their site could use links to an external page instead of repeating the same code; and would only need to change one piece of script to make changes to the whole site.
As an ethical search engine optimisation company, we believe in using valid code, and JavaScript can often cause problems with this. Using external JavaScript files will remove any validation problems that are caused by JavaScript, making a site even more search engine friendly. For these reasons, it is a good idea to put all JavaScript in external files.
Dave Stewart
Design Technician
No Comments
No comments yet.
RSS feed for comments on this post
TrackBack URI
Leave a comment
Just Search Weblog
Archives:
Pages:
Meta:
Categories:
- Accessibility
- Affiliate Marketing
- Content Writing
- Cowboys
- Downloads
- Internet Marketing
- Job Vacancies
- Latest News
- Pay Per Click
- Press Releases
- Search Engine Optimisation
- Testimonials
- Web Analytics
- XHTML














