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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2011
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Adding hyperlink to jQuery?

    jQuery("#user-dialog-email").html((data && data.Email) ? data.Email : "(none)");


    I'm trying make all the email address in a search result to show up as link to it's email address.


    Can anyone help? Anyone know where I need to add the code to make this work?

    Thanks in advance

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,391
    Thanks
    11
    Thanked 568 Times in 561 Posts
    So data.Email contains the email address?

    Then you can add links to the emails by using the <a href="mailto:..."> notation easily
    Code:
    jQuery("#user-dialog-email").html((data && data.Email) ? "<a href=\"mailto:"+data.Email+"\">"+data.Email+"</a>" : "(none)");


  •  

    Posting Permissions

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