javascript - Call number on page load / document ready -


i need create blank webpage url like: https://www.example.com/callme , share link our customers.
when clicks link, blank page load, , document ready or dom content loaded, has automatically dial specific number on mobile devices.
can link tag href "tel:xxxxx", need automatically clicked when page load, not click/tap manually.
here tried far no success:

document.addeventlistener('domcontentloaded', function() {  $('#call').trigger('click'); }, false); 

and

$(document).ready(function(){ $('#call').click(); }); 

and

$(document).ready(function(){ $('#call').trigger('click'); }); 

and here simple html:

<a href="tel:142;" id="call">call me</a> 

any advice appreciated, in advance

simply include one-liner change client's url tel-link

window.location.href="tel:123456789"; 

if on device has handler tel-links (a mobile-phone example) phone app open , give them opportunity call you


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -