search engine optimisation  
Site search engine optimisation by MakeMeTop
  UK Search Engine Listings » | national | regional | specialist | UK SEO firms | submit a site |  
  Articles » | recent articles | archived articles | news | submit an article |  
  Resources » | forum | newsletter | SEO resources | webmaster resources | suggest a site |  
  Info » | about us | contact us | feedback | site credits |  
:: Home » Articles » | archived articles |
 



Archived Articles


Website promotion 101: removing JavaScript from a web page (or 'Putting your web pages on a diet')
  Ben Ellis | 15 March 02
 

As web pages get increasingly more advanced so does the amount of code needed. The result may be a beautiful looking page that performs many things well ...except ranking highly in the search engines. Search engine spiders are fussy eaters and don't really like anything with their HTML, especially not a side order of JavaScript.

First check the source code of your web page, especially the <head> section as this is where most JavaScript is placed. For example, if your page includes rollover buttons it's probably heavy with JavaScript. All this code gets in the way of the spiders and doesn't help in achieving good rankings for your site. But there's an answer - remove it. The beauty is that removing this code from each page not only makes your page more 'digestible' for search engines but it also makes the maintenance of the JavaScript code easier.

The Two Step Plan

1. Highlight all the JavaScript in your page in between (not including) the <script language="javascript"> and the </script>, and then copy and paste it into a new notepad document (or whatever you use). Save this document as 'scripts.js'. On your web page you should now be left with <script language="javascript"> and then </script>. Now all you need to do is add the address of this external JavaScript page into the opening JavaScript tag, something like this:

<script language="javascript" src="scripts.js"></script>

This tag now tells the browser that it should go to scripts.js to get all the relevant JavaScript code for the page.

2. Upload the external JavaScript page (scripts.js) to your web site and then replace all the existing JavaScript code on your pages with just the one single line <script language="javascript" src="scripts.js"></script>.

This example assumes that your external JavaScript page and your web pages are all being uploaded into the root directory, if they are not then you will have to check the url of the src="scripts.js" on each page to make sure the JavaScript is working properly.

The advantage of having one JavaScript page is that if you have to make any changes to it you only need to do it once instead of going into every page of your site and making the same change.

If you have two sets of JavaScript code then just do this twice so you end up with the following in your <head> tag:

<script language="javascript" src="scripts1.js"></script>
<script language="javascript" src="scripts2.js"></script>
And now for the main course

Removing other bits of code to slim your pages down and make them easier to maintain and change can be achieved by using CSS (Cascading Style Sheets) and SSI (Server Side Includes).

To find out about CSS here are some sites to start you off gently:

1. http://htmlgoodies.earthweb.com/beyond/css.html
2. http://www.websitetips.com/css/index.shtml
3. http://www.web-building.com/css.php3#style

For help with SSI:

1. http://www.useforesite.com/tut_ssi.shtml
2. http://www.websitetips.com/ssi/index.html
3. http://www.smartwebby.com/web_site_design/server_side_includes.asp

   
  Ben Ellis is Head of Visibility Services at DVisions Ltd, a UK online marketing company based in Brighton.
 
Reproduction rights
You may reproduce this article in any format as long as the content is not edited and the "About the author" portion above remains intact.
 


 
  Use our constantly updated list of the most popular UK search engines and directories:
  1) Google UK
  2) Yahoo
  3) MSN
  4) AOL
  5) Ask Jeeves
   
   
   
   
   
   
   
   
 
 
 
 
National Listings | Regional Listings | Specialist Listings | Recent Articles | SEO Resources | About us | Contact us | Feedback | Home  
© SearchEngineSpy 2003