$('#divKonumum').click(function(){ if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var whatsAppLink='whatsapp://send?text=http://www.google.com/maps/place/'+position.coords.latitude+','+position.coords.longitude+'&phone=+31623239665'; window.open(whatsAppLink); }); } });
<a id="aLocation" href="..."> ... </a>
$('document').ready(function(){ if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var whatsAppLink='whatsapp://send?text=http://www.google.com/maps/place/'+position.coords.latitude+','+position.coords.longitude+'&phone=+31623239665'; $('#aLocation').attr('href',whatsAppLink); }); } });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)