Guest User

Untitled

a guest
Aug 11th, 2013
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1.  
  2. Jquery mobile page code:
  3. <!DOCTYPE html>
  4. <html>enter code here
  5. <head>
  6. <meta charset="utf-8">
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=no">
  11. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  12.  
  13. <link href="jquery.mobile.theme-1.3.2.min.css" rel="stylesheet" type="text/css"/>
  14. <link href="jquery.mobile.structure-1.3.2.min.css" rel="stylesheet" type="text/css"/>
  15.  
  16.  
  17. <script src="jquery-1.6.4.min.js" type="text/javascript"></script>
  18. <script src="jquery.mobile-1.3.2.min.js" type="text/javascript"></script>
  19.  
  20. <script src="iscroll.js"></script>
  21. <script src="jquery.mobile.iscrollview.js"></script>
  22. <script src="additional-site-specific-scripts.js"></script>
  23.  
  24. </head>
  25. <body>
  26.  
  27. <div data-role="page" id="page5" data-theme="b">
  28.  
  29. <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>
  30. </div>
  31.  
  32. <div data-role="content" align="center">
  33.  
  34.  
  35. <p id="demo">Click the button to get your coordinates:</p>
  36. <button onClick="getLocation()">Button</button>
  37. <script>
  38. var x=document.getElementById("demo");
  39. function showPosition(position)
  40. {
  41. //alert("456");
  42. x.innerHTML="Latitude: " + position.coords.latitude +
  43. "<br>Longitude: " + position.coords.longitude;
  44. }
  45. function showPositionn(position)
  46. {
  47. //alert("456");
  48. x.innerHTML="Latitude: " + "<br>Longitude: " ;
  49. }
  50. function getLocation()
  51. {
  52.  
  53. if (navigator.geolocation)
  54. {
  55. //alert("123");
  56. navigator.geolocation.getCurrentPosition(showPosition);
  57. //alert("123");
  58.  
  59. }
  60. else{x.innerHTML="Geolocation is not supported by this browser.";}
  61. }
  62.  
  63. </script>
  64.  
  65.  
  66. </div>
  67. <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>
  68.  
  69. </div>
  70.  
  71.  
  72. </div>
  73.  
  74.  
  75.  
  76.  
  77. </body>
  78. </html>
Advertisement
Add Comment
Please, Sign In to add comment