Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
#datarefcustomjs
#datarefcustomjs

Code Block
languagejs
Info
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');



In this case the #Object:objid# will be pulled in by the JS function.

...