WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Site Design > Graphics & Design Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-10-2008, 02:27 AM
jram23 jram23 is offline
WebProWorld New Member
 

Join Date: Oct 2005
Posts: 2
jram23 RepRank 0
Default 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!!!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 08:22 AM
incrediblehelp's Avatar
incrediblehelp incrediblehelp is offline
Moderator
WebProWorld Moderator
 

Join Date: Jan 2004
Location: Live in Cincy Now
Posts: 7,438
incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4
Default Re: Javascript Navigation or CSS navigation?

Use CSS as it is much more spider friendly.
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 09:52 AM
kgun's Avatar
kgun kgun is online now
WebProWorld 1,000+ Club
 

Join Date: May 2005
Location: Norway
Posts: 4,696
kgun RepRank 3kgun RepRank 3
Default 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.

Last edited by kgun : 04-10-2008 at 10:24 AM.
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 04:58 PM
ran_dizolph's Avatar
ran_dizolph ran_dizolph is online now
WebProWorld Veteran
 

Join Date: Jul 2005
Location: Windsor, ON
Posts: 476
ran_dizolph RepRank 1
Default 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.
Reply With Quote
  #5 (permalink)  
Old 04-10-2008, 05:32 PM
cormip cormip is offline
WebProWorld New Member
 

Join Date: Jan 2007
Posts: 1
cormip RepRank 0
Default 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
Reply With Quote
  #6 (permalink)  
Old 04-10-2008, 05:33 PM
httpman's Avatar
httpman httpman is offline
WebProWorld Pro
 

Join Date: Aug 2003
Location: France
Posts: 193
httpman RepRank 0
Default 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 ! ]
Reply With Quote
  #7 (permalink)  
Old 04-10-2008, 06:28 PM
niggles niggles is offline
WebProWorld Member
 

Join Date: Oct 2005
Posts: 31
niggles RepRank 1
Default 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/
-------------------------------------------------
Reply With Quote
  #8 (permalink)  
Old 04-10-2008, 06:33 PM
freelancedesigners.com's Avatar
freelancedesigners.com freelancedesigners.com is offline
WebProWorld Member
 

Join Date: Sep 2005
Location: US
Posts: 26
freelancedesigners.com RepRank 1
Default 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
__________________
-Webmaster Wes | Don't go and misunderestimate me!
Graphic Design Jobs | Web Design | Ninja Freelance | Ancient Ninja Wisdom
Reply With Quote
  #9 (permalink)  
Old 04-10-2008, 08:32 PM
bj's Avatar
bj bj is offline
WebProWorld 1,000+ Club
 

Join Date: Apr 2005
Location: Delaware Valley, PA
Posts: 1,181
bj RepRank 2bj RepRank 2
Default 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.
Reply With Quote
  #10 (permalink)  
Old 04-10-2008, 08:57 PM
jannmirch's Avatar
jannmirch jannmirch is offline
WebProWorld Member
 

Join Date: Sep 2005
Location: Yorktown Heights, NY
Posts: 77
jannmirch RepRank 0
Default 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.
__________________
Graphic & Web Design
www.jannmirch.com
Reply With Quote
  #11 (permalink)  
Old 04-11-2008, 12:42 AM
jram23 jram23 is offline
WebProWorld New Member
 

Join Date: Oct 2005
Posts: 2
jram23 RepRank 0
Default Re: Javascript Navigation or CSS navigation?

First, thanks all for your suggestions.

Now, I understand the value of using CSS menus. I also think that I can try out the PHP include concept in my pages. But all my pages needs to be .php file. Right now I have all the pages as .html.

Is there a way by which I can redirect all my .html file to .php file using ".htaccess"?
Reply With Quote
  #12 (permalink)  
Old 04-11-2008, 03:34 AM
jawn_tech's Avatar
jawn_tech jawn_tech is offline
Moderator
WebProWorld Moderator
 

Join Date: Jun 2004
Location: USA
Posts: 1,757
jawn_tech RepRank 2
Default Re: Javascript Navigation or CSS navigation?

Yes you can write a 301 redirect in your htaccess to redirect all of your pages.

It's also advisable to be sure to have an xml sitemap for Google to see any and all changes to your website.

The PHP include is a great tool, I've used it. Very convenient when adding or changing around links -- just change the one file instead of editing every page. A must-have for any website that intends to grow, unless the site is utilizing a CMS (content management system i.e. Mambo, etc)
__________________
Get the facts! Fact Frenzy
Domains, Hosting, & Tools


Last edited by jawn_tech : 04-11-2008 at 03:38 AM.
Reply With Quote
Reply

  WebProWorld > Site Design > Graphics & Design Discussion Forum


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


Search Engine Friendly URLs by vBSEO 3.0.0