有时点击页面某个按钮,希望能掉起手机拨号页,实现步骤如下:
- [1] 在index.html中添加如下代码
<meta name="format-detection" content="telephone=yes" />
- [2] 点击按钮调用函数
callPhone (phoneNumber) { window.location.href = 'tel://' + phoneNumber }
有时点击页面某个按钮,希望能掉起手机拨号页,实现步骤如下:
<meta name="format-detection" content="telephone=yes" />
callPhone (phoneNumber) {
window.location.href = 'tel://' + phoneNumber
}