我正在使用 Kartograph.js 加载 svg 地图。但是页面加载时出现以下错误:
Uncaught TypeError: Cannot read property 'getAttribute' of undefined
View.fromXML
Kartograph._mapLoaded
j
k.fireWith
x
b
这是我的代码:
<html>
<head>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="raphael-min.js"></script>
<script type="text/javascript" src="kartograph.js"></script>
<script type="text/javascript">
function loadMap(){
var map = kartograph.map('#map', 600, 0);
map.loadMap('World.svg')
}
</script>
</head>
<body onLoad="loadMap()">
<div id="map"></div>
</body>
</html>