在支持应用程序的模式下在Mobile Safari中使用mailto:link时出错 [英] Error when using mailto: link in Mobile Safari in app-capable mode

查看:120
本文介绍了在支持应用程序的模式下在Mobile Safari中使用mailto:link时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网页上有一个表单,其中的操作是mailto:email(其中电子邮件是真实的电子邮件地址)。当我在常规模式下在Mobile Safari中加载此页面时(即,没有从具有应用程序功能模式的主屏幕启动),这很好 - 在我提交表单后,电子邮件应用程序出现了。但是,当我处于应用程序模式并从主屏幕启动时(因此,没有Safari chrome),并提交表单我收到错误URL无法显示。但是,当处于应用程序模式时,常规mailto:链接(即,不在表单中) 可以正常工作。

I've got a form in a web page with an action that is "mailto:email" (where email is a real email address). When I load this page in Mobile Safari in regular mode (ie, not launched from home screen with app-capable mode), this works fine - after I submit the form, the email app comes up. However, when I'm in app-capable mode and have launched from the home screen (so, no Safari chrome), and submit the form I get the error "URL can't be shown". However, a regular mailto: link (ie, not in a form) does work when in app-capable mode.

是否有其他人注意到这个?有任何变通方法吗?是否在应用程序模式下不允许使用表单?

Has anyone else noticed this? Any workarounds? Are forms disallowed in app-capable mode?

谢谢,

Elisabeth

Elisabeth

推荐答案

这准确地描述了这个问题。 mailto链接没有任何问题,mailto链接无法加载。通常网络应用程序崩溃。

This accurately describes the issue. There is nothing wrong with the mailto link, the mailto link fails to load. Often the webapp crashes.

有趣的是tel:电话号码链接工作正常。

The funny thing is that tel: link for telephone numbers work fine.

窗口.location.replace实际上工作。谢谢!

window.location.replace does in-fact work. Thanks!

这是jQuery自动解决这个问题...

Here is the jQuery to fix this automatically...

$('a[href^=mailto]').click(function (event) {
    event.preventDefault();
    window.location.replace = $(this).attr('href');
    return false;
});

这篇关于在支持应用程序的模式下在Mobile Safari中使用mailto:link时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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