Search Optimization
  Home arrow Search Optimization arrow Page 6 - Improve Your Rankings with a Sitemap T...
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

Improve Your Rankings with a Sitemap That Works: The CSS
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2005-10-17

    Table of Contents:
  • Improve Your Rankings with a Sitemap That Works: The CSS
  • Begin Improving the Sitemap Visuals
  • Finishing Off the Selectors
  • The Improved Look of the Sitemap
  • Making the Styles Work in Mozilla
  • Sitemap Style Switcher

  • 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


    Improve Your Rankings with a Sitemap That Works: The CSS - Sitemap Style Switcher


    (Page 6 of 6 )

    The JavaScript function that selects the correct stylesheet is extremely simple; it just detects whether the browser is MSIE, and re-writes the href attribute of the link element if it is:

    function iestyle() {
      if (document.body.createTextRange() != 'undefined') {
        a = document.getElementById('link')
        a.setAttribute('href','sitemapStyle.css');
      }
    }

    As the createTextRange method is proprietary to Ineternet Explorer, it will not return undefined when IE is in use.  When this condition is true, it selects the link element in the a variable and replaces the href attribute with the URL to the Microsoft-friendly CSS file using the setAttribute method.  When a browser that doesn’t implement createTextRange (or any IE only object of your choice) runs the script, it will return undefined and the href attribute will not be changed in the HTML file, leaving the Mozilla friendly stylesheet in use.

    The only down-side to this is that with JavaScript switched off in the browser, a visitor will default to the pretty plain looking un-styled list, so be sure to include <noscript> tags at the top of the page.  Again, it’s more junk for the spiders to swallow, but it is good practice and should be adhered to, your visitors shouldn’t suffer at the hands of your SEO campaign.

    Finally, just add an onload event handler to the <body> element of the main HTML page that calls the function then the page has loaded, and link the JavaScript file to the head of the HTML document.  JavaScript should not be used in-line because it is something else that the search engine crawlers dislike and is more unnecessary data for them to ingest.

    Test the page now in the mainstream browser of your choice and you should see the page as you intended to.  There are still minute differences in the way the page is rendered in any of the different browsers but overall, it will look and feel the same.

    An optimized sitemap should be part of any SEO campaign.  Your entire site should be search-engine friendly and contain (at the very least) a sitemap already. You’ll find that search engine spiders may start to like your site a little more after they find your stash of links.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Hi all,This artile follows on from the previous Sitemap SEO article and disusses...
       · font-size:12; - 12 what? padding:0 5 0 5; - 5 what?feet? points?...
       · lol, you are right to queery it, I apologise for the lack of precision. I thought...
     

    SEARCH OPTIMIZATION ARTICLES

    - Implementing Six Sigma Methodology for SEO
    - Introducing Six Sigma Methodology for SEO
    - What is Mobile SEO?
    - Using Lynx for SEO Analysis
    - Mastering Lynx (Open Source Text Browser) fo...
    - 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



     



    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek