SEO and Javascript

There are many things talked about SEO and how to use JavaScript in a web page so as to not have any ill effects on the sites rankings. After going through a much detailed in-depth research on the JavaScript and its usage in a web page, I think following should be known to all the people in an SEO/SEM industry.

I will start with what JavaScript’s are used for. Then I will move forward to where JavaScript’s are normally placed in a web page. Finally, I will conclude with what should be the best possible way a JavaScript should be used with a web page.

JavaScript’s Purpose:

This can be used for many purposes. Let’s name a few purposes where it can be used. It can be used for rollover button images, drop-down menus/sub-menus, it can be used for performing form validations…

JavaScript Location:

There is no specific place where a JavaScript can be added in a web page. It can be added at the top of the page, in the middle of the page, at the bottom of the page or it can be called from an external file.

1) JavaScript between "head" section:

Most of the developers add JavaScript code at the top of the page in the "head" section. By doing this it helps them to separate the coding part of the page with that of the design. Thus this eases work for a developer to set apart code from the design essentials.
But, by doing this kind of JavaScript placement, when search engines crawl a web page they get code at the very beginning and many a times they find it very difficult to crawl it. At times it so happens that they often feel that this is a spammy site and thus get rated poorly. Many a times they get stuck up in the coding loops and finally they don’t have anything but to abort the page crawl. Thus, our web page will not be crawled fully resulting in poor rankings and other stuff.

2) JavaScript at the bottom:

When JavaScript is placed at the bottom of the page it can be considered a better idea then the previous one. This is because in here search engines can at least crawl the complete page and thus a web page can get indexed properly in the google’s database. Now the only problem here is that even if the page is crawled completely search engine crawlers have to crawl JavaScript code at the bottom which might again result in a tedious task for them. So this method is better then the previous one but cannot be considered the best.

3) JavaScript in external file

The best way to use JavaScript in a webpage is to call it from an external file. This ensures that the page is clean only with the content and few lines of html tags used in for the designing purpose. By doing this we can think of that now search engines will not get any code which can deviate them from their purpose of crawling a web page. Hence, it should be highly recommended to have JavaScript in an external file.

One Way Link Exchange | Reciprocal Link Exchange | Exchange Directory Links
Link Service | Link Exchange Process | Types of link exchange
Link Exchange Report | Client | Sitemap
Link Exchange Resource