当我尝试使用 IPMapper 获取给定 IP 地址的纬度和经度时,我收到以下错误“RefrenceError: IPMApper not defined”。为了您的清楚,我指定了代码。
<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>