...

View Full Version : Using Javascript and a normal link at the same time



matthewlesh
07-17-2007, 09:48 AM
i am trying at the moment to add a feature to a website which will using forms of ajax get a page and show it to the user keeping the header and footer parts.

The problem i am having is allowing for search engines and non-javascript enabled users to be able to use the links as well.

What i would like to do is allow for both, so if the user has javascript the link will automatically load the function to do what it needs to do, and if the user (or search engine) doesn't have javascript it will just read the link as normal and go to that page.

Thank you for your time, i would love any help you can give me.

Kor
07-17-2007, 09:57 AM
<a href="thatpage.html" onclick="somefunction();return false">click</a>


return false prevents the href HTML action for javascript enabled users.

matthewlesh
07-17-2007, 10:26 AM
thanks very much for that... and wow, i didn't realize it was so easy :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum