Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I can open whatsapp from standart href link without any problem. Also firefox is works very good.
But i need javascript for sending location. So i write a javascript code.
If i open it on private web page and using window.open command it works perfectly.
But if i open it from normal tab it doesn't work. My web page also has ssl certificate.
What is the wrong ?

What I have tried:

$('#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);
			});
		}
});
Posted
Updated 29-May-17 3:28am
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900