【问题标题】:how to show device dialing pad on number when click/select on number in mobile application在移动应用程序中单击/选择号码时如何在号码上显示设备拨号盘
【发布时间】:2016-04-01 10:33:30
【问题描述】:

我们开发混合移动应用程序。

在这个应用程序中,当点击/选择号码时,它应该会显示在设备的拨号盘上。

我们必须遵循哪些步骤?

$(function(){
    if(navigator.userAgent.match(/(iPhone|Android.*Mobile)/i))
    {
        $('a[data-tel]').each(function(){
            $(this).prop('href', 'tel:' + $(this).data('tel'));
        });
    }
})
 <table>
        <tr><td style="padding:2px">Traiff</td><td style="padding:8px"><a data-tel="974-4433665588" href="tel:974-4433665588" data-rel="external" style="color:#333946 !important">974-4433665588</a></td></tr>
       	<tr><td style="padding:2px">Divil</td><td style="padding:8px"><a data-tel="974-4433665588" style="color:#333946 !important">974-4433665588</a></td></tr>
       	</table>

这是我的应用链接
http://desktop-tsrno5e:10080/_MobileBrowserSimulator/index.html?webpage=/datepicker/apps/services/preview/ww/android/1.0/&platform=android

【问题讨论】:

    标签: jquery html css numbers phone-call


    【解决方案1】:

    只需使用.click()函数

    $(function(){
      if(navigator.userAgent.match(/(iPhone|Android.*Mobile)/i)) {
        $('a[data-tel]').click(function(){
           $(this).prop('href', 'tel:' + $(this).data('tel'));
        });
      }
    })
    

    【讨论】:

    • 我认为你在这里遗漏了一些东西是工作示例jsfiddle.net/mca7aaqk
    • 我们是否需要在android manifest.xml文件中添加任何权限
    • 我不这么认为尝试删除 navigator.userAgent 条件只是为了测试并告诉我
    • if(match(/(iPhone|Android.*Mobile)/i)
    • 我得到了解决方案,这就是解决方案将 更改为 在 config.xml 中
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-25
    相关资源
    最近更新 更多