jQuery - get current full URL with window.location.href

0 votes
227 views
added Oct 22, 2020 in jQuery by lcjr First Warrant Officer (11,930 points)

Get it through window.location.href method. 

$('#wadonedeal').click(function(){
  var whatsAppPhone = '<?php echo $agentDet['contact']; ?>';
  var defaultMessage = "Hi, found you on";
  window.open(
  "https://wa.me/"+'+60'+whatsAppPhone+"?text="+defaultMessage+" "+window.location.href,
  '_blank',
  );
});

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...