Liam Delahunty: Home Tips Web Contact
Recommended laptop
under £500
.

Think I deserve a present? See my Amazon Wish List

How to use JavaScript without hurting your search engines rankings

JavaScript enhanced pages often hurt the ranking in search engines. This is due to the fact that the JavaScript is placed in the section of the document, pushing the actual text content far lower on the page than is optimal in respects to what the search engines are looking for "relevancy-wise".

Any JavaScript code that you would normally place in the section of your web page can be placed into a separate .js file. This file should only contain your JavaScript code, without any other HTML codes. To call this external file, just reference it like this in the section of your page:

<SCRIPT language="JavaScript" src="scripto.js"> </SCRIPT>

When the page is loaded by the browser it will follow this link to get the JavaScript code. Of course, you can name the file anything you want as long as it ends with a .js extension.

Certainly you should experiment with this on your server to make sure it will work for you. Some servers may not recognize the .js file type and open a file download. To use this method successfully, your server must be set to map .js files to the MIME type application/x-javascript. If it doesn't work, then your server probably isn't setup for this application and you will have to contact the ISP or web hosting support and ask them to update the servers settings for this MIME type.

Share this!