I get the following error: "RefrenceError: IPMApper not defined" when I try to get the Latitude and longitude for a given IP address using IPMapper. I refine the code for your clarity.
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>IP Address geocoding on Google Maps</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="ipmapper.js"></script> $(function(){ try{ IPMapper.initializeMap("map"); IPMapper.addIPMarker("111.111.111.111"); } catch(e){ alert(e); } }); </head> <body> <input id="ip" name="ip" type="text" /> <button onclick="IPMapper.addIPMarker($('#ip').val());">Geocode</button> <div id="map" style="height: 500px;border: red 4px;"></div> </body> </html>
source share