homepage Welcome to WebmasterWorld Guest from 54.196.63.93
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
onClick vs. href for SEO purposes
combine onclick event for js users and href for non-javascript users
jexx

10+ Year Member



 
Msg#: 4503 posted 12:33 am on Oct 6, 2005 (gmt 0)

i am tryin to come up with a good solution that uses onClick events to switch div layers on a single page (without reload) for javascript enabled browsers (i.e not SE spiders) and regular href anchors to load the (hidden) div layer on a new page as visible for non-javascript enabled browsers, including the search engine spiders.

setting href='#' allows me to use onClick to control the div visibility, however, i want to be able to set the href='widget_desc.html' but not actually load widget_des.html from the base widget.html page. instead, just show the widget_desc hidden layer, as described above.

does anybody have a good javascript solution that allows this behavior?
obviously, the href must be set initially and then altered using js.

 

gph

10+ Year Member



 
Msg#: 4503 posted 12:44 am on Oct 6, 2005 (gmt 0)

href="widget_desc.html" onclick="return blah()"

function blah(){
// do whatever
return false
}

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved