const share = function(){ navigator.share({ title: 'mobsted.com', text: 'Check out mobsted platform', url: 'mobsted.com/?utm_referer=#Object:objid# }) .then(() => console.log('Successful share')) .catch((error) => console.log('Error sharing', error)); }
if (navigator.share) { document.getElementById("btnShare").onclick = share } else { document.getElementById("btnShare").onclick = () => alert('Sharing does not work'); |