Guest User

Untitled

a guest
Feb 6th, 2019
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.98 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. <style>      /* Always set the map height explicitly to define the size of the div
  10.        * element that contains the map. */
  11.       #map {
  12.         height: 100%;
  13.       }
  14.       /* Optional: Makes the sample page fill the window. */
  15.       html, body {
  16.         height: 100%
  17.       }</style>
  18.   </head>
  19.   <body>
  20.     <div class="container navanimation">
  21. Home        <a href="current.html">Current</a>
  22.         <a href="track.html">Track</a>
  23.         <a>ABOUT</a>
  24.         <a>CONTACT</a>
  25.       </div>
  26.                
  27.                 <div style="padding-left:16px">
  28.                     <p id="showIp"></p>
  29.                     <p id="showCity"></p>
  30.                     <p id="showCountry"></p>
  31.                     <p id="showIsp"></p>
  32.                 </div>
  33.                 <input name="box" type="text" placeholder="Put in IP here" id="box" class="searchField"/>
  34.                 <button type="button" class="btn btn-primary btn-sm" onclick="checkInfo()">Run!</button>
  35.  
  36.       <div id="map"></div>
  37.     <script>
  38.       var map;
  39.       function initMap() {
  40.         map = new google.maps.Map(document.getElementById('map'), {
  41.           center: {lat: -34.397, lng: 150.644},
  42.           zoom: 8
  43.         });
  44.       }
  45.     </script>
  46.     <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
  47.    async defer></script>
  48.  
  49.  
  50.     <script>
  51. function addtoIp(add)
  52. {
  53. var ipnmbrs = "";
  54. for(i = 0; i < add.length; i++)
  55. {
  56.    if(add[i] != ".")
  57.    {
  58.        if(!isNaN(add[i])) ipnmbrs += add[i];
  59.        else {
  60.            alert("no letters");
  61.            break;
  62.        }
  63.    }
  64.    else if(add[i] == ".") ipnmbrs += ".";
  65. }
  66. return "http://extreme-ip-lookup.com/json/" + ipnmbrs;
  67. }
  68.  
  69.  
  70. function checkInfo()
  71. {
  72.    var ipInfo = document.getElementById("box").value;
  73.        $.getJSON(addtoIp(ipInfo), function(data) {
  74.                    console.log(JSON.stringify(data, null, 2));
  75.                    var info = JSON.parse(JSON.stringify(data, null, 2));
  76.                    var ip = info.query;
  77.                    var city = info.city;
  78.                    var country = info.country;
  79.                    var isp = info.isp;
  80.                    var business = info.business
  81.  
  82.              
  83.                    document.getElementById("showIp").innerHTML = ip;
  84.                    document.getElementById("showCity").innerHTML = city;
  85.                    document.getElementById("showCountry").innerHTML = country;
  86.                    document.getElementById("showIsp").innerHTML = isp;
  87.                });
  88.            }
  89.                    </script>
  90.                     <script>
  91.                         require('./renderer.js');
  92.                     </script>
  93.   </body>
  94. </html>
Add Comment
Please, Sign In to add comment