<script> var ua = navigator.userAgent.toLowerCase(); var url = "sms:0"; var is_os8 = (ua.indexOf("os 8") > -1) ? "&" : ";"; url += (ua.indexOf("iphone") > -1 || ua.indexOf("ipad") > -1) ? is_os8 : "?"; url += "body=" + encodeURIComponent("Hey check this out <xt:url />"); document.write('<div><a class="xt_button" href="'+url+'">Text this page to your friends</a></div>'); </script>Show in textarea