这是我的代码。我只想要一个使用jQuery的简单地图。但是,当我在浏览器中打开地图时,我看不到地图。当我删除此语句时:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
我可以看到地图。但是我也需要在同一页面中使用此脚本。
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
#map {
width:700px;
height:400px;
}
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="js/jquery.gomap-1.3.2.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(function() {
$("#map").goMap();
});
</script>
</head>
<body>
<div class="main"></div>
<div id="map"></div>
</body>
</html>
在此先感谢您的帮助。
使用 jQuery.noConflict
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="http://www.pittss.lv/jquery/gomap/js/jquery.gomap-1.3.2.js"></script>
<script>
var jq = jQuery.noConflict()
jq(function() {
jq("#map").goMap();
});
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句