Welcome to WebmasterWorld Guest from 54.160.221.82

Forum Moderators: open

Message Too Old, No Replies

onClick vs. href for SEO purposes

combine onclick event for js users and href for non-javascript users

     
12:33 am on Oct 6, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 26, 2004
posts:63
votes: 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

12:44 am on Oct 6, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Jan 31, 2002
posts:285
votes: 0


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

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