Closed NARKOZ closed 5 years ago
Thanks.
@huacnlee When using the WhatsApp as it's implemented, the snippet doesn't show and doesn't include the URL. I.e. You have to append the urlencoded URL to the text itself. Because including the URL as a query parameter doesn't work. I'm doing following work around:
//set up the url
var url = "whatsapp://send?text=";
//define the message text
var title = $(document).find("title").text();
var canonical = $("link[rel='canonical']").attr("href");
var text = title + " at " + canonical;
//encode the text
var encodedText = encodeURIComponent(text);
//set the href attribute on the link
$whatsApp_app.attr("href", url + encodedText);
Is it possible to add it?