Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using Javascript and a normal link at the same time

    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.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Code:
    <a href="thatpage.html" onclick="somefunction();return false">click</a>
    return false prevents the href HTML action for javascript enabled users.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks very much for that... and wow, i didn't realize it was so easy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •