使用jQTouch时,无法使用mailto链接打开Mobile Safari的邮件应用程序。什么可能是错的? [英] I can't get mailto links to open the Mail app from Mobile Safari when using jQTouch. What could be wrong?

查看:109
本文介绍了使用jQTouch时,无法使用mailto链接打开Mobile Safari的邮件应用程序。什么可能是错的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 jQTouch 开发iPhone Web应用程序,它包含一个简单的 mailto:链接到一个有效的电子邮件地址,它应该在点击时启动iPhone邮件应用程序 - 但它不会。



如果我请访问Mobile Safari中的正常网页,其中包含完全相同的链接,然后点击它,我会得到预期的结果:邮件应用程序在收件人字段中弹出正确的电子邮件地址。



以下是链接HTML(地址已更改),以防万一我疯了并犯了一个愚蠢的错误,但它看起来非常好:

 < p>< a href =mailto:info@mycompany.com> info@mycompany.com< / a>< / p> 

有没有人在使用jQTouch时碰到过这个问题?或者至少有人能提出一种我可以调试的方法吗?当我点击非工作链接时,它会闪烁红色(活动链接状态),绝对没有其他事情发生。 解决方案

我再次查看了jQTouch演示包中的示例代码,并发现他们正在向其电子邮件链接添加 target =_ blank属性。



我在链接上做了这个,并开始工作(弹出邮件客户端窗口)。但是,标准网页中的链接也可以正常工作,但没有 target =_ blank属性...



我很困惑,但如果您的移动网页使用jQTouch,添加该属性似乎可以解决此问题。


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:info@mycompany.com">info@mycompany.com</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.

解决方案

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.

这篇关于使用jQTouch时,无法使用mailto链接打开Mobile Safari的邮件应用程序。什么可能是错的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆