Minimizing Javascript

By Jacqueline Sinex, Wednesday, August 25, 2010

Sometimes a little bit of javascript is necessary to control certain features in a website, such as a simple slideshow element on a page, which was a better choice over the heavy Flash animation.  But as organic SEO becomes more prominent, we must learn to minimize the presence of javascript among our web page code, and strive for “clean” search-engine-friendly code.

Instead of including your javascript directly on the web page, link to it as a source.

In the head of the page, create the script tag, but instead of including the script code within the container of the script tags, link to an external javascript file.  For best organization, store your javascript file in a /js folder (or /scripts or something similar).  Your linked tag will appear in this format:

<script language=”javascript” src=”js/filename.js” /></script>

Now, as your page code is read, this is referenced on one line and the search engines (or other resources) do not need to wade through a long javascript to get to the important meat of your website – the content.

Facebooktwitterredditlinkedinmail

Posted in: Austin Web Design, How To, Quick Tips, Tech Support, Web Development, Web Site Maintenance

Comments are closed.