Search Optimization
  Home arrow Search Optimization arrow Page 5 - Optimizing a JavaScript Site for Searc...
SEO Chat Forums  
Choosing Keywords  
Google Optimization  
Link Trading  
MSN Optimization  
Search Engine News  
Search Engine Spiders  
Search Optimization  
Web Directories  
Website Marketing  
Website Promotion  
Website Submission  
Yahoo Optimization  
SEO Tools
Adsense Calculator
AdSense Preview
Advanced Meta-Tags
Alexa Rank Tool
Check Server Headers
Class C Checker
Code to Text Ratio
CPM Calculator
Domain Age Check
Domain Typos
Future PageRank
Google Dance
Google Keywords
Google Search
Google Suggest
Google vs Yahoo
Indexed Pages
Keyword Cloud
Keyword Density
Keyword Difficulty
Keyword Optimizer
Keyword Position
Keyword Typos
Link Popularity
Link Price Calculator
Meta Analyzer
Meta Tag Generator
Multiple Link Popularity
Page Comparison
Page Size
PageRank Lookup
PageRank Search
Robots.txt Generator
ROI Calculator 
S.E. Comparison 
S.E. Keyword Position 
Site Link Analyzer 
Spider Simulator 
URL Redirect Check 
URL Rewriting 
Mobile Linux 
APP Generation ROI 
IBM® developerWorks 
SEO Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
SEARCH OPTIMIZATION

Optimizing a JavaScript Site for Search Engines
By: Jennifer Sullivan Cassidy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 15
    2005-11-09

    Table of Contents:
  • Optimizing a JavaScript Site for Search Engines
  • Drawbacks of JavaScript in Respect to SEO
  • Content Positioning
  • Keyword Density, Navigation, Link Strategies
  • Functionality and Optimization
  • Move the Code
  • Navigation and Effects
  • Noscript Tags
  • Your Sitemap

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Optimizing a JavaScript Site for Search Engines - Functionality and Optimization


    (Page 5 of 9 )

    Functionality and Optimization

    So how do you combine the benefits of optimization with the value and functionality of JavaScript?  There are a few things you can do to improve your overall SEO value of your site, even with JavaScript.

    1.  Off-load your JavaScript

    The best way to optimize a page with JavaScript is to move the code to an external file, then simply point to it in your HTML.  Let’s compare some code.  The following example is a web page with JavaScript to display the current date, as you saw in Figure-1.  The first example shows the code directly in the HTML header.

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>My Website</title>
    <script language="javascript" type="text/javascript">
    <!--
    function GetDay(nDay)
    {
     var Days = new Array("Sunday","Monday","Tuesday","Wednesday",
                          "Thursday","Friday","Saturday");
     return Days[nDay]
    }

    function GetMonth(nMonth)
    {
     var Months = new Array("January","February","March","April","May","June",
                            "July","August","September","October","November","December");
     return Months[nMonth]     
    }

    function DateString()
    {
     var Today = new Date();
     var suffix = "th";
     switch (Today.getDate())
     {
      case 1:
      case 21:
      case 31:
       suffix = "st"; break;
      case 2:
      case 22:
       suffix = "nd"; break;
      case 3:
      case 23:
       suffix = "rd"; break;
     };

     var strDate = GetMonth(Today.getMonth())+ " " + Today.getDate()+ ", " ;
                  if (Today.getYear() < 2000)
                    { 
                    strDate = strDate + (Today.getYear() +1900);
                    }
                  else
                   {
                   strDate=strDate + Today.getYear();
                   }
     return strDate;
    }


    document.write(DateString());
    //--></script>
    </head>
    <body>
    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ligula lorem, consequat eget, tristique nec, auctor quis, purus. Vivamus ut sem. </p>
    </body>
    </html>

    Example 1: JavaScript Date Function directly in HTML

    Placing this code in the HTML of your web page not only takes up a lot of space, it forces the search engine spider to wade through many lines of code, affecting your text to code ratio, your keyword density, and your content positioning.

    More Search Optimization Articles
    More By Jennifer Sullivan Cassidy


       · What experience do you have in optimizing JavaScript? What are some obstacles...
       · I am in the middle of a site restructuration, the site is for a major brand and as...
       · Unfortunately, for SEO to be effective for your client, they really need to listen...
       · Jennifer,I understand the gist of your article, but how does google, for...
       · Googlebot views the javascript of AdSense the same as they do any other JavaScript:...
     

    SEARCH OPTIMIZATION ARTICLES

    - More Blogging Tips: Cooking with Gas
    - Blogging Tips from Julie and Julia
    - SEO Essentials: the Proper Web Server and Pl...
    - Steps to Higher Rankings and Traffic
    - Building Linkable Pieces and Titles
    - Page Rank Sculpting
    - Page Rank Optimization
    - ClickTale Review
    - Final Issues: Moving Blogger to WordPress wi...
    - Avoid the Mistakes New SEOs Make
    - Move Your Blogger Blog to WordPress: Getting...
    - How to Move from Blogger to WordPress Using ...
    - Must Have WordPress SEO Plugins
    - Creating Search Engine Friendly URLs with PHP
    - Online Reputation Management with SEO





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    Stay green...Green IT