The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to send a custom SMS from html page?
Solution
post Aug 27 2024, 07:42 PM
Post #1





Group: Members
Posts: 1
Joined: 27-August 24
Member No.: 29,229



I am trying to make simple web page that using phone's current location with google map via SMS.

But I stuck with custom SMS body and even calling google map url.

How can I create custom body like "I am here: https://www.google.com/maps?f=q&q=87.92...46.908853"?

CODE
   <html>
  <head>
    <title>Geolocation</title>
    <!-- playground-hide -->
    <script>
if (navigator.geolocation) { // device can return its location
    navigator.geolocation.getCurrentPosition(function(position) {
         console.log(position.coords.latitude);
         console.log(position.coords.longitude);            
    });
}
    </script>    
<p>
<a href="sms:+123456789?&body= + I am here: maps.google.com/position.coords.latitude + + position.coords.longitude..">Send location!</a>
</p>
</body>    
</html>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 12th December 2024 - 06:57 AM