SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with "mailto:" command

    I am having a problem with this command in xhtml:

    a href=mailto:anybody@anywhere.com /a

    It opens the email program just like it is supposed to, but it also opens a blank browser page. How can I stop this from happening?

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to enclose that attribute value in quotes:
    <a href="mailto:anybody@anywhere.com">link text</a>

    Oh, and welcome to SitePoint Forums!
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    You need to enclose that attribute value in quotes:
    <a href="mailto:anybody@anywhere.com">link text</a>

    Oh, and welcome to SitePoint Forums!
    Thank you

    When I wrote the attribute into my page I did use quotes as designated. Sorry for the typo.

    Funny thing is the line seems to work everywhere else. I downloaded the code archive that goes with my book ("Build your own website the right way") and the attribute on their page opens the email program only on my computer. I even copy/pasted the line from that file into my own page, but when I tried it I opened the email program and a blank webpage. So what could be different about my file that is causing this to happen?

  4. #4
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,287
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    It's possible (maybe?) that you've set this browser up to automatically open up new windows upon clicking a link? Like in FF where many people have the default set to open link in new tab?

    Does it open a blank webpage on any other machines or browsers? The only way I can think of that it would do this is if the target attribute was in the code, and it isn't, so... my guess is a browser default.

  5. #5
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It can't be a browser default because when I open the page in the code archive from Sitepoint, I do not get a blank broeser page.

  6. #6
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,287
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    Maybe... does it do it by default only on local files? (is this page of yours on a server just like sitepoint's, or on a local machine?)

  7. #7
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Neither file is on a server - they are both downloaded to my computer (is that what you mean by "local"?) BTW I am a newbie if you haven't already guessed...

  8. #8
    SitePoint Member Tybe-O's Avatar
    Join Date
    Mar 2008
    Location
    NL, Rotterdam
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there one of these in your page?

    HTML Code:
    <base target="_blank">
    If so, remove it and see what happens.

    If not, does it open a blank popup or a 'real' browser page? There might be some javascript actions messing things up...


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
  •