Welcome to WebmasterWorld Guest from

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)

10+ Year Member

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.


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

10+ Year Member

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

function blah(){
// do whatever
return false


Featured Threads

Hot Threads This Week

Hot Threads This Month