javascript help needed!

Jump to First Reply
Posted:
in General Discussion edited January 2014
ok, i know this isn't really the place for this, but it is late here and i'm struggling and hoping some AI members might help!



in a html page i am doing i need to show different code depending on what browser the user has.



e.g. by default this code appears:



Code:


<a href="#" onclick="new Effect.SlideDown('mobilepanel');return false;"><img src="images/caseimages/case1.jpg" alt="Mobile phone" width="181" height="167" border="0" /></a>







but in older browsers i need to show:



Code:


<a href="foo.html"><img src="images/caseimages/case1.jpg" alt="Mobile phone" width="181" height="167" border="0" /></a>







i have a couple of instances of this in a page.



i'm not really a javascript person (as you can tell) and i've googled and keep trying but am now really stuck.



Comments

  • Reply 1 of 2
    Have you tried to combine the two? Link to the foo.html page instead of "#", but keep the onclick code in place. Browsers with Javascript on will see the effect, and browsers without will get sent to foo.html.
     0Likes 0Dislikes 0Informatives
  • Reply 2 of 2
    othelloothello Posts: 1,054member
    Quote:

    Originally posted by geekdreams

    Have you tried to combine the two? Link to the foo.html page instead of "#", but keep the onclick code in place. Browsers with Javascript on will see the effect, and browsers without will get sent to foo.html.



    THANK YOU! that was so obvious and cannot work out why it didn't occur to me. up too late, working too long and a 4 month old baby so no sleep!



     0Likes 0Dislikes 0Informatives
Sign In or Register to comment.