Advertisement
Guest User

Untitled

a guest
Feb 6th, 2019
1,079
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Simple Map</title>
  5. <meta name="viewport" content="initial-scale=1.0">
  6. <meta charset="utf-8">
  7. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  8. <link rel="stylesheet" type="text/css" href="style.css">
  9. </head>
  10. <body>
  11. <div class="container navanimation">
  12. Home <a href="current.html">Current</a>
  13. <a href="track.html">Track</a>
  14. <a>ABOUT</a>
  15. <a>CONTACT</a>
  16. </div>
  17.  
  18. <div style="padding-left:16px">
  19. <p id="showIp"></p>
  20. <p id="showCity"></p>
  21. <p id="showCountry"></p>
  22. <p id="showIsp"></p>
  23. </div>
  24. <input name="box" type="text" placeholder="Put in IP here" id="box" class="searchField"/>
  25. <button type="button" class="btn btn-primary btn-sm" onclick="checkInfo()">Run!</button>
  26.  
  27. <div id="map"></div>
  28. <script>
  29. var map;
  30. function initMap() {
  31. map = new google.maps.Map(document.getElementById('map'), {
  32. center: {lat: -34.397, lng: 150.644},
  33. zoom: 8
  34. });
  35. }
  36. </script>
  37. <script src="https://maps.googleapis.com/maps/api/js?key=&callback=initMap"
  38. async defer></script>
  39.  
  40.  
  41. <script>
  42. function addtoIp(add)
  43. {
  44. var ipnmbrs = "";
  45. for(i = 0; i < add.length; i++)
  46. {
  47. if(add[i] != ".")
  48. {
  49. if(!isNaN(add[i])) ipnmbrs += add[i];
  50. else {
  51. alert("no letters");
  52. break;
  53. }
  54. }
  55. else if(add[i] == ".") ipnmbrs += ".";
  56. }
  57. return "http://extreme-ip-lookup.com/json/" + ipnmbrs;
  58. }
  59.  
  60.  
  61. function checkInfo()
  62. {
  63. var ipInfo = document.getElementById("box").value;
  64. $.getJSON(addtoIp(ipInfo), function(data) {
  65. console.log(JSON.stringify(data, null, 2));
  66. var info = JSON.parse(JSON.stringify(data, null, 2));
  67. var ip = info.query;
  68. var city = info.city;
  69. var country = info.country;
  70. var isp = info.isp;
  71. var business = info.business
  72.  
  73.  
  74. document.getElementById("showIp").innerHTML = ip;
  75. document.getElementById("showCity").innerHTML = city;
  76. document.getElementById("showCountry").innerHTML = country;
  77. document.getElementById("showIsp").innerHTML = isp;
  78. });
  79. }
  80. </script>
  81. <script>
  82. require('./renderer.js');
  83. </script>
  84. </body>
  85. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement