Results 1 to 7 of 7

Thread: JavaScript equivalent of href="mailto:emialaddress@gmail.com"

  1. #1
    Join Date
    Mar 2010
    Posts
    67

    JavaScript equivalent of href="mailto:emialaddress@gmail.com"

    Code:
    <tr height="20">
                      <td height="20" width="145"><font size="2" face="Arial">Email Address</font></td>
                      <td height="20" width="156"><a href="mailto:emailaddress@gmail.com"><font size="2" face="Arial">
                              <script type="text/javascript"> generateEmail("Email", "Address")</script> </font></a></td>
                    </tr>
    I built a generate email function with the help of javaScript to replace the email address in the content of the anchor tag (in the above written code). Unfortunately, the plain text email address still resides in the href attribute. I would like to delete this using javaScript as well, any advice on this ?

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    JavaScript equivalent of href="mailto:emialaddress@gmail.com"

    You are going right but there are some changes that you need to made in the code that and I have something for you that can help you to figure it out.

    <td height="20" width="145"><font size="2" face="Arial">Email Address</font></td>
    <td height="20" width="156"><a href="javascript:generateEmail('Email', 'Address')"><font size="2" face="Arial">
    <script type="text/javascript"> generateEmail("Email", "Address")</script> </font></a></td>
    </tr>


    Try the same thing with this code ...

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    JavaScript equivalent of href="mailto:emialaddress@gmail.com"

    Hi,

    There is a best one extension for Dreamweaver which will help immensely. You need to download the Super Email in case if you get a chance and you can find it on the official site of Dreamweaver. The sample output would be as follows :

    <script language="JavaScript" type="text/javascript">

    document.write('<a href=\"mailto:test'+ '@' + 'test.com\">');
    document.write('Hello Rastogi</a>');

    </script>

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    JavaScript equivalent of href="mailto:emialaddress@gmail.com"

    If you are a good programmer then you need to be aware about every terms and techniques that is already provided by the programming language and you need to take all of the benefits to improve the efficiency of your application. There are so many programmers aware about some terms, by the way. I have something new that can perform this task within the few seconds, you need add only predefined component of the programming language with the herf tag.

    location.href = "mailto:emialaddress@gmail.com";

    You should see the code that I have attached for you in the attachment section..Just take a look there !!!!!
    Attached Files Attached Files

  5. #5
    Join Date
    Dec 2009
    Posts
    263

    How to change anchor text from javascript

    I am also running with some similar issue as rastogi have but it is not the issue of email tag specially but I need to replace the texts within the tag. Actually, my problem is that I require to change anchor text from java script?But don't how it would be done ??? Do you have any suggestion on such issue

    Your help would be appreciated ....Thank you

  6. #6
    Join Date
    Apr 2008
    Posts
    3,267

    JavaScript equivalent of href="mailto:emialaddress@gmail.com"

    You should use this code to perform the text replacement and I hope it would done as you want. try it out and post me if you are getting any type issue to implementing it or executing...

    Code:
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="Content-Script-Type" content="text/javascript">
    <title>Example</title>
    </head>
    <body>
    <ul>
    <li><a href="http://www.Techarena.in" onclick="this.firstChild.data = 'loading...'">Techarena</a></li>
    </ul>
    </body>
    </html>

  7. #7
    Join Date
    Dec 2009
    Posts
    263

    Re: JavaScript equivalent of href="mailto:emialaddress@gmail.com"

    Thanks for your pretty suggestion. i am trying to resolve this problem with my own. Now, I want to know about your suggestion on such implementation of the following code which is described below, Any more recommendation on this ...

    I have tried something like it, but it doesn't work what I need to do with it :

    <a href='...' id='hlnk1'>Text</a>
    <button id="btnExporta" onClick="document.Form1.hlnk1.innerHtml ='newText' Text="Exporta" ></button>


    Any chnages are required in this code or entirely invalid...please give your own views on this .

    Thanks ..

Similar Threads

  1. Replies: 7
    Last Post: 04-01-2012, 09:14 PM
  2. Replies: 6
    Last Post: 18-05-2010, 12:27 AM
  3. href="javascript:func()" vs href="#" onclick="javascript:func()"
    By BansiJI in forum Software Development
    Replies: 6
    Last Post: 12-05-2010, 10:02 AM
  4. <A HREF="#" onClick="window.open ('sitename.html') ...>
    By Amy Adams in forum Software Development
    Replies: 4
    Last Post: 11-05-2010, 12:45 PM
  5. Error on clicking "mailto" link
    By Dipu in forum Technology & Internet
    Replies: 4
    Last Post: 09-05-2009, 10:36 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,439,664.51717 seconds with 17 queries