Using External Coding To Improve Search Engine Placement

Do you have lots of JavaScript coding in the headermake a change to the JavaScript or CSS styles you
section of your web pages? Do you re-list your CSSwould need to do so on every page that the code
styles at the top of every page? Do you havehad been copied onto.
JavaScript coding spread throughout your webBoth of these problems can be solved simply by
pages?using external files. You create one external file for
If you answered yes to any of these questions youryour CSS and another file for your JavaScript. These
site may be driving away search engine spiders andcould be named mysite.css for the CSS and mysite.js
losing search engine position ranking.for the JavaScript. These files can be created in any
As you can imagine search engine spiders have a lotplain text editor or html code editor, they are nothing
of pages to get through on the web when they aremore than files that contain most of the CSS or
indexing sites. To improve their speed and efficiencyJavaScript code from the web pages.
search engines program their spiders to give up easilyWith JavaScript you have an opening JavaScript tag,
if they have problems with a page or if they have tothen a comment tag, then assorted functions and
wade through too much code to find the relevantwhat not, followed by a closing comment tag and a
content.closing JavaScript tag. Your external file would start
This is one of the reasons why it is so important towith the opening comment tag, contain all the
put your keywords as close to the top of the pagefunctions and such, and end with the closing
as possible. This way the search bot will see thecomment tag. You would leave both the opening and
keywords before giving up and moving on to theclosing JavaScript tags in the html page. If you have
next page.more than one JavaScript on the page you can
But what do you do if you have lots of JavaScriptmove all the code into one external js file. Simply
code or CSS styles pushing your keywords down thecopy it into the file in the same order as it exists in
page in your coding? You need to find a way to cutthe JavaScript tags on the html page. You will only
down on all that code that gets in the way of theneed the one pair of opening and closing comment
search engines properly indexing your page.tags.
We do this by moving the JavaScript and CSS stylesOnce your JavaScript is moved off the page you will
off the page and into external files. This is a fairlyneed to tell the web page where to find it. This is
easy and straight forward process and can have thedone in the JavaScript tag that was left on the page
added benefit of making your pages load faster asin the head section. Right now this will be an opening
well, which the search engines also like.JavaScript tag placed right up against the closing
In many ways CSS styles and JavaScript work in aJavaScript tag, with no additional code in between.
similar fashion. You set up functions in a script orYou will place the reference to the external
formatting in a style sheet section, and then refer toJavaScript code inside the opening JavaScript tag like
that section in your html code. For instance if youthis:script language="JavaScript" type="text
have a JavaScript that displays a clock on your pageJavaScript" src="mysite.js"
you would have the JavaScript functions for thePlacing CSS styles in an external file is handled in
clock listed in your head section, then you wouldexactly the same manner. Move the styles into the
simply call that function from the place on the pageexternal file, and then refer to that external file with
where the clock would be displayed.your style tag in the head section of the web page
Similarly with CSS you set up your styles ahead oflike this:link href="mysite.css" rel="stylesheet"
time in a Styles section of the page head, then youtype="text/css"
simply refer to the styles as needed in your htmlAn added benefit of moving the code into external
coding. One benefit of this is that it cuts downfiles is that you can then change the styles of your
dramatically on the amount of formatting codewhole site simply by changing the code in the one
needed when compared to using Font tags.external file.
If you want to use the same JavaScript or CSSOnce you have moved the code into external files
styles on a different page you could copy all thatyou will have greatly simplified the code on each
code onto the new page. But this would cause twopage. This will take you a long way towards making
distinct problems, first you would be adding a lot ofyour pages lean and mean, and very search engine
code to each page and second if you wanted tofriendly.