SEOMen SEO Course






 

09 - JavaScript

Last Updated April 11 2007 02:23:49.

Javascript has many uses on a webpage. It shouldn't be overdone, and for the most part, you will get by without any and exceed. You'll do better without javascript.

Now, having said that, I really should explain some. For the most part, what happens within java and javascript can't be seen by a search engine spider. So, when they come along to your site and index you ... that snazzy super duper hover over and popup navigation menu doesn't even get seen by Googlebot. So Googlebot never even finds your other pages.

Not good. Really not good. You have a really expensive website that noone is ever going to find because you have effectively hidden it from the search engines. This is, in essence, the same as opening a Convenience Store/Gas Station, at the very end of an unpopulated 20 mile long dead end road.

Ouch! Does that hurt? You bet it does. I have more than once got a new client only to find out that his site is nothing but javascript, flash or some imaging creation software, and not one byte is visible to a search engine. Go to the Google Cache and it's a blank sheet. Nuttin. Nada. Squatso.

I stay away from javascript menus. You can achieve some really nice results with CSS. Text links are what you want ... keyword rich text links. We want our links to say "widgets" not "     ".

OK, I did say java has some good points too. Well yes. It does. I use a quick little javascript to update the year on my pages. I use the little script frequently. I figure it doesn't hurt too much if I have a copyright without a year cached in the engines.

Here is the script for you to use:

<!-- begin get year -->
<SCRIPT LANGUAGE="Javascript"><!--
var Date=new Date()
var Year=Date.getYear()
if (Year < 1000)
Year+=1900
document.write(""+Year+"")
//--></SCRIPT><!-- end get year -->

The above will display this:



It's great huh! But, if you are writing pages with a .php extension here is an even simpler way to display the date.

<?php echo date('Y'); ?>

Which will display:

2008

Y stands for year in this example. This isn't about optimization so I won't provide you with a PHP tutorial about the date function here. If you need to know, Google for "php date".

 


SEOMen Factoid
  • Like Flash, JavaScript is ignored by the engines.
  • JavaScript navigation menus are not indexable, consequently there is no way to find your site.
  • JavaScript has a place but needs to be used sparingly.



   V0.7 :: 02-11-2007
   01-26-07 / 37