asapltda Posted February 26 Share Posted February 26 Good morning, I run the following code to get the GPS location: 1 . If the form is made with unigui movile on the desktop it shows the data of the gps position on the screen, but it does not work on the mobile 2.if I do it in the form of a desktop it works on the desktop BUT it doesn't work on the mobile. I could see if the desktop code is different than the mobile code or if it's something else, thanks for your contribution. <!DOCTYPE html> <html> <head> <style> .btn { width: 200px; /* Ancho del botón */ height: 50px; /* Altura del botón */ } </style> </head> <body> <p>Click the button to get your coordinates.</p> <button class="btn" onclick="getLocation()">Try It</button> <p id="demo"></p> <script> var x = document.getElementById("demo"); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML = "Geolocation is not supported by this browser."; } } function showPosition(position) { x.innerHTML = "Latitude: " + position.coords.latitude + "<br>Longitude: " + position.coords.longitude; top.ajaxRequest(Ext.get(document.getElementById('uniqueFrameID')).component, 'coords', {latitude: position.coords.latitude, longitude: position.coords.longitude}); } </script> </body> </html> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.