javascript - Whatsapp button working on Android but Blank on IOS -
this code working on android device samsung galaxy tab , s3 etc. after selecting contact, appears thetitle -> theurl
.
but it's not working @ ios device iphone 6 plus , iphone 5. after selecting contact, thetitle -> theurl
not appear, it's blank.
how can fix this?
var thetitle = "post title text", theurl = "blog.com/url-post.html"; $('#myid').after('<a class="button-share whatsapp" data-action="share/whatsapp/share" href="whatsapp://send?text=' + thetitle + ' -> ' + theurl + '" target="_blank">whatsapp</a>');
solved.
text value must encode @ ios whatsapp.
var thetitle = "post title text", theurl = "blog.com/url-post.html", nuklear = thetitle + ' ›› ' + theurl, bomb = encodeuricomponent(nuklear); $('#myid').after('<a class="button-share whatsapp" data-action="share/whatsapp/share" href="whatsapp://send?text=' + bomb + '" target="_blank">whatsapp</a>');
tested: working on android , ios
Comments
Post a Comment