Javascript 调用Open Tel时关闭当前窗口:
当我调用window.location.href(“电话:“+”+006019999”)时,它会打开Skype,但工作正常。但我不希望当前浏览器窗口保持打开状态,我想关闭它。如果我关闭,它甚至不会打开Skype。这可能吗Javascript 调用Open Tel时关闭当前窗口:,javascript,tel,Javascript,Tel,当我调用window.location.href(“电话:“+”+006019999”)时,它会打开Skype,但工作正常。但我不希望当前浏览器窗口保持打开状态,我想关闭它。如果我关闭,它甚至不会打开Skype。这可能吗 <html> <script> window.onload = function () { window.location.href="tel:+0060199999"; window.close(); }
<html>
<script>
window.onload = function () {
window.location.href="tel:+0060199999";
window.close();
}
</script>
<body>
Let me test
</body>
</html>
window.onload=函数(){
window.location.href=“电话:+006019999”;
window.close();
}
让我测试一下
“它将打开Skype”-不在我的计算机上。这不是一种方法吗?!window.location.href()?你是说window.open吗?it location.href,它可以替换为window.open(“电话:“+”+006019999“,”u self”),但它仍然不工作。我尝试了location.href和window.open。一个只尝试打开电话应用程序的页面有什么好处?只需直接链接tel:
URI即可。