Submit Your Article Forum Rules

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Javascript Navigation or CSS navigation?

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    2

    Javascript Navigation or CSS navigation?

    Hi All,

    I really need your suggestions in making my navigation system effective.

    I maintain a website with over 1k pages. The website has a drop-down navigation which is in all of the pages. The navigation is created using the CSS( <UL> and <LI> ). The navigation items are updated regularly. So what I did is, I pasted the navigation part into a Javascript called menu.js. So what the Javascript has is document.write('menu items'). Now I just call the menu.js on top of all pages. So whenever changes is needed, I just update the menu.js. So the navigation gets updated in all the pages.

    Is this a right way to do. I see many sites having the navigation in HTML itself. But my problem is whenever I make changes to the navigation, I need to upload all the files to my server which is time consuming. And I am little lazy to update the 1k pages

    And I am aware that having navigation inside a Javascript won't do good to Google. So is there any other way to have a better navigation system?

    Thanks a lot in advance!!!

  2. #2
    WebProWorld MVP incrediblehelp's Avatar
    Join Date
    Jan 2004
    Posts
    7,567

    Re: Javascript Navigation or CSS navigation?

    Use CSS as it is much more spider friendly.

  3. #3
    WebProWorld MVP kgun's Avatar
    Join Date
    May 2005
    Location
    Norway
    Posts
    7,999

    Re: Javascript Navigation or CSS navigation?

    Completely agree

    Code:
    <ul>
    <li> Menu 1 item here with CSS styling. </li>
    ................................................................... <li> Menu n item here with CSS styling. </li>
    </ul>
    That is best for SeBots, surfers and disabled people. You can of course use the same technoque on submenus.

    There is a Norwegian site (shall I tell about it - a competitor of my menu system. WPW members are the bosses, so here it is: bMenu

    "bMenu focuses on navigation technology which improves and standardizes navigation on web, Intranets and mobile terminals.
    Search has lately been seen as the only way to navigate Internet. bMenu is patent pending (US, PCT, NO) technology which improves access to web content and gives a much faster and better overview than traditional navigation or search results. It also increases page views for advertising sites and sales for e-commerce sites. Today we have some of the major portals in Norway as beta customers.
    Behind bMenu you will find some of the top people within programming and development with experience from companies like Fast, Yahoo and Opera.
    Investor is Alliance Venture.
    The backbone of the technology is built on Fast’s technology platform.
    bMenu is now located in Norway and New York and is establishing office in San Francisco".

    It uses the Fast engine, scan web sites for content that is automatically added to the menu system. You can scan a Chinese site and automatically produce English menus on your site.)

    There is a free and paid versions. The most advanced are for companies.

  4. #4
    Senior Member ran_dizolph's Avatar
    Join Date
    Jul 2005
    Posts
    561

    Re: Javascript Navigation or CSS navigation?

    Use CSS. People have the option to turn Javascript off, thusly rendering your navigation invisible.

    Plus, CSS can be significantly lighter, and easier to manage/update.

  5. #5
    Junior Member
    Join Date
    Jan 2007
    Posts
    3

    Re: Javascript Navigation or CSS navigation?

    Simply replacing menu.js to update your navigation is also a problem because of browser caching. Visitors returning to your site may reuse a cached copy of menu.js and will not see your menu changes.

    Paul Cormier

  6. #6
    Senior Member httpman's Avatar
    Join Date
    Aug 2003
    Posts
    121

    Re: Javascript Navigation or CSS navigation?

    You should only use HTML + CSS.
    Many use a ul / li structure. This is the right way for SE spiders to browse your menus, and therefore your website.
    Then you can add DHTML effects (drop down menus, progressive transparency and anything else) using with Javascript - but the whole menu structure should be readable to SE spiders, what means : HTML / CSS only.

    JP
    www.net-createurs.com [ french only website sorry ! ]

  7. #7
    Member
    Join Date
    Oct 2005
    Posts
    40

    Re: Javascript Navigation or CSS navigation?

    The CSS vs JScript issue aside, if you have 1000+ pages and you're needing to change things regularly, you should really be putting your menu in an "include" file of some kind. You can do this with most servers that let you put up .php, .asp or .shtml pages.

    This way, you change one central file and it flows through the whole site.

    That combined with your CSS menus would give the best of both worlds.

    Cheers,
    Niggles
    -------------------------------------------------
    World Music World - bringing the World's Folk Music Cultures Together
    http://www.worldmusicworld.com/
    -------------------------------------------------

  8. #8

    Re: Javascript Navigation or CSS navigation?

    You can also include the actual link HREF tags in a style sheet? I wasnt aware of that capability.

    If you want the menu to be the same on every page you should use include files -this is very easy to do in PHP, ASP, perl or even SHTML

    you create one HTML file then include it into you 1000 files.

    you would still use CSS as described above

  9. #9
    Senior Member bj's Avatar
    Join Date
    Apr 2005
    Posts
    1,171

    Re: Javascript Navigation or CSS navigation?

    I just wrote an article about this lately. Though the article is specific to a js menu in Wordpress, the reasons for not using this type of menu are pertinent to anyone using or considering using javascript menus.

    http://kickasswebdesign.com/wordpres...ibility-no-no/

    Google Webmaster Guidelines has this to say: "While Googlebot is great at understanding the structure of HTML links, it can have difficulty finding its way around sites which use JavaScript for navigation. We’re working on doing a better job of understanding JavaScript, but your best bet for creating a site that’s crawlable by Google and other search engines is to provide HTML links to your content."

    Why can you not use php to include the menu? It renders like html and you can include the file.

  10. #10
    Senior Member jannmirch's Avatar
    Join Date
    Sep 2005
    Posts
    229

    Re: Javascript Navigation or CSS navigation?

    BJ, you took the words right out of my - well - keyboard.

    I had never used php before and recently took over a website for a client. Her previous designer had started doing navigation with php but had a different php file for every page so the background would highlight which page you were on.

    By cleaning up the CSS I was able to achieve the same results and use one php file for the navigation menu. Worked beautifully.

    Though I confess I do prefer Dreamweaver's library functionality, which does basically the same thing but I can see what it will look like on the page. The downside is you need to update (it will do it automatically for you) all the pages and reupload.
    Marketing & Web Design www.WestchesterMarketingCafe.com
    Twitter: @JannMirch
    FB: Marketing Cafe

Page 1 of 2 12 LastLast

Similar Threads

  1. Javascript Navigation Buttons.
    By adbart in forum Search Engine Optimization Forum
    Replies: 9
    Last Post: 01-08-2007, 08:48 PM
  2. Javascript Navigation & SEO
    By mktgbill in forum Search Engine Optimization Forum
    Replies: 14
    Last Post: 07-16-2006, 11:20 PM
  3. Navigation Change from JavaScript to ?
    By incrediblehelp in forum Search Engine Optimization Forum
    Replies: 11
    Last Post: 03-21-2006, 05:09 PM
  4. Javascript Pop Up Navigation and Robots?
    By peak in forum Search Engine Optimization Forum
    Replies: 5
    Last Post: 01-14-2004, 01:12 AM
  5. JavaScript for navigation useability/W3C questions
    By iainrstewart in forum Graphics & Design Discussion Forum
    Replies: 5
    Last Post: 10-22-2003, 06:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •