Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Jquery mobile page code:
- <!DOCTYPE html>
- <html>enter code here
- <head>
- <meta charset="utf-8">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=no">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <link href="jquery.mobile.theme-1.3.2.min.css" rel="stylesheet" type="text/css"/>
- <link href="jquery.mobile.structure-1.3.2.min.css" rel="stylesheet" type="text/css"/>
- <script src="jquery-1.6.4.min.js" type="text/javascript"></script>
- <script src="jquery.mobile-1.3.2.min.js" type="text/javascript"></script>
- <script src="iscroll.js"></script>
- <script src="jquery.mobile.iscrollview.js"></script>
- <script src="additional-site-specific-scripts.js"></script>
- </head>
- <body>
- <div data-role="page" id="page5" data-theme="b">
- <div data-role="header" data-position="fixed" data-tap-toggle="false" data-transition="none" data-id="footer" data-theme="b" align="center" ><h1>Header</h1>
- </div>
- <div data-role="content" align="center">
- <p id="demo">Click the button to get your coordinates:</p>
- <button onClick="getLocation()">Button</button>
- <script>
- var x=document.getElementById("demo");
- function showPosition(position)
- {
- //alert("456");
- x.innerHTML="Latitude: " + position.coords.latitude +
- "<br>Longitude: " + position.coords.longitude;
- }
- function showPositionn(position)
- {
- //alert("456");
- x.innerHTML="Latitude: " + "<br>Longitude: " ;
- }
- function getLocation()
- {
- if (navigator.geolocation)
- {
- //alert("123");
- navigator.geolocation.getCurrentPosition(showPosition);
- //alert("123");
- }
- else{x.innerHTML="Geolocation is not supported by this browser.";}
- }
- </script>
- </div>
- <div data-role="footer" data-position="fixed" data-tap-toggle="false" data-transition="none" data-id="footer" data-theme="b" align="center" ><h4>Footer</h4>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment