【问题标题】:Page redirection for mailto and tel links on AndroidAndroid 上 mailto 和 tel 链接的页面重定向
【发布时间】:2015-07-09 04:08:05
【问题描述】:

我有一个可用的 Cordova iOS 应用程序。现在我正在开发一个 Android 应用程序。我有一个“联系我们”页面,其中有一个链接:

 <a id="lnkEmail" style="border: none;box-shadow: none;text-align: left;" data-role="button"  href="#">  support@website.com          </a>

 $('#lnkEmail').on('click',function(){
         document.location.href = "mailto:support@site.com";
    });

当链接在电子邮件客户端中打开时,该页面被重定向到“网页不可用”错误页面。如何停止页面重定向?我试过了:

 <a style="border: none;box-shadow: none;text-align: left;" data-role="button"  **href="mailto:support@site.com"** target="_top">support@site.com </a>

还有:

 <a id="lnkEmail" style="border: none;box-shadow: none;text-align: left;" data-role="button"  **href="javascript: void(0);"**>support@site.com</a>  support@site.com         </a>

我该如何解决这个问题?

【问题讨论】:

    标签: android cordova android-webview mailto tel


    【解决方案1】:

    mailto 的处理方式存在错误,它会在加载电子邮件客户端之前尝试导航到页面。

    你可以试试inAppBrowser plugin

    window.open('mailto:support@site.com', '_system');
    

    【讨论】:

      猜你喜欢
      • 2018-10-06
      • 2012-06-18
      • 2020-02-04
      • 2015-06-23
      • 2016-04-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-18
      相关资源
      最近更新 更多