Search code examples
htmliphonejqtouchmailto

I can't get mailto links to open the Mail app from Mobile Safari when using jQTouch. What could be wrong?


I'm developing an iPhone web app using jQTouch, and it contains a simple mailto: link to a valid email address, which should launch the iPhone mail application when tapped—but it doesn't.

If I visit a "normal" web page in Mobile Safari which contains the exact same link, and tap on it, I get the expected result: the mail app pops up with the correct email address in the To field.

Here's the link HTML (with the address changed) just in case I'm going nuts and have made a stupid mistake, but it appears perfectly fine:

<p><a href="mailto:[email protected]">[email protected]</a></p>

Has anyone come across this when using jQTouch? Or can anyone at least suggest a way that I can debug this? At the moment when I tap the non-working link it flashes red (the active link state) and absolutely nothing else happens.


Solution

  • I looked again at the example code in the jQTouch demo package and saw that they were adding a target="_blank" attribute to their email link.

    I did this to my link, and it began working (popping up the mail client window). However, the link that's in a standard web page works as well, but without the target="_blank" attribute...

    I'm puzzled, but adding that attribute seems to solve this problem if your mobile page is using jQTouch.