0

I need to open the sms application of mobile with prefilled body and recipient by clicking on a URL.

so I wrote this code and it is working fine in firefox. But it is not working in chrome.

 <html>
 <head>
 <script type="text/javascript">
  function f(){ 
   window.location="sms://+12345?body=1234";} 
 </script> 
 </head>
 <body onload="f();">
 </body>
 </html>

Any idea to fix?

binarysta
  • 156
  • 11
  • 1
    Check this question: https://stackoverflow.com/questions/6480462/how-to-pre-populate-the-sms-body-text-via-an-html-link – KiT O Jul 16 '18 at 07:55
  • 1
    Possible duplicate of [How to pre-populate the sms body text via an html link](https://stackoverflow.com/questions/6480462/how-to-pre-populate-the-sms-body-text-via-an-html-link) – KiT O Jul 16 '18 at 07:55
  • Thanks, but it is not working for chrome – binarysta Jul 16 '18 at 10:39
  • 1
    `sms:1234?&body=test` works fine here on Firefox 61 desktop, Safari 11 desktop, Chrome 67 desktop and android. Please read other answers and comments on that question. – KiT O Jul 16 '18 at 10:57

0 Answers0