Widely used among the leading web browsers and search engines, JavaScript is a client-side (as opposed to server-side, which takes longer to compute) scripting language used to enhance the end-user experience and allow for dynamic, interactive web content.
For example, AdSense, Google’s affiliate search engine marketing program, uses JavaScript to deliver dynamically generated text ads to web pages. Web pages and browsers use “Cookies,” or small files of data enabled using JavaScript, to track a user’s actions on a website such as what web pages he visited or which ads he clicked on. JavaScript is also used for ecommerce to add items to a shopping cart, process online forms, indicate to a user that an item on a form has been omitted or filled in incorrectly, to submit orders to be shipped, and to display all sorts of dynamic content to users, such as advertisements, related items, and shipping or tax information.
It is very important to search engine optimize a page that is using JavaScript in order to best control the way in which the search engine bot that is scanning the page sees the web page content. It all has to do with the way in which the search engine prioritizes what is “sees” on a web page. The information that appears near the top of the page is given the greatest weight for defining what the page is about. JavaScript language looks like gobbledygook to the search bot. It does not help the search engine understand what the web content is about. As a result, it is best to optimize the web page by placing the JavaScript information off-page in an external file. This technique serves much the purpose as a Cascading Style Sheet, where relevant, web page content is placed at the top of the page where the search engine spider expects to find it.