1,通过index.asp运行就会弹出“错误提示.jpg”的提示
2,如果直接运行index.html的就正常运行
注:index.html为index.asp运行并提示错误后源码保存的页面信息
求助:为什么通过ASP运行就会有这种错误提示呢?
<head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>酷讯酒店地图</title> </head> <body> <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"></script> <style type="text/css"> a{text-decoration:none;color:#6ce;font-size:14px;} a:hover{text-decoration:underline;} </style> <% sql = "select * from dat" '多出来这句 就提示了错误 %> <div style="float:left;width:520px;height:340px;border:1px solid gray" id="container"></div> <div style="float:left;width:200px;height:340px;border:1px solid gray;border-width:1px 1px 1px 0;padding:0 10px 0 0;line-height:1.8em;"> <ul> <li><a onMouseOver=openMyWin(infoWindow0,point[0]) href=#>张味记</a></li> <li><a onMouseOver=openMyWin(infoWindow1,point[1]) href=#>有意思餐饮</a></li> </ul> </div> </body> <script type="text/javascript"> var map = new BMap.Map("container"); var point = new BMap.Point(120.258449,28.809791); map.centerAndZoom(point, 14); map.enableScrollWheelZoom(); var myIcon = new BMap.Icon("http://dev.baidu.com/wiki/static/map/API/examples/images/Mario.png", new BMap.Size(32, 70), { imageOffset: new BMap.Size(0, 0) }); var point = [new BMap.Point(120.263767,28.805598),new BMap.Point(120.262415,28.815247),]; var marker0 = new BMap.Marker(point[0],{icon:myIcon}); var marker1 = new BMap.Marker(point[1],{icon:myIcon}); map.addOverlay(marker0); map.addOverlay(marker1); map.setViewport(point); var opts0 = {offset : new BMap.Size(0, -25), title : '<span style="font-size:14px;color:#0A8021">如家快捷酒店</span>'}; var opts1 = {offset : new BMap.Size(0, -25), title : '<span style="font-size:14px;color:#0A8021">如家快捷酒店</span>'}; var infoWindow0 = new BMap.InfoWindow("<div style=line-height:1.8em;font-size:12px;><b>地址:</b>北京</br></div>", opts0); var infoWindow1 = new BMap.InfoWindow("<div style=line-height:1.8em;font-size:12px;><b>地址:</b>北京市</br></div>", opts1); marker1.addEventListener("mouseover", function(){this.openInfoWindow(infoWindow1);}); marker0.addEventListener("mouseover", function(){this.openInfoWindow(infoWindow0);}); function openMyWin(id,p){ map.openInfoWindow(id,p); } </script>
<head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>酷讯酒店地图</title> </head> <body> <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"></script> <style type="text/css"> a{text-decoration:none;color:#6ce;font-size:14px;} a:hover{text-decoration:underline;} </style> <div style="float:left;width:520px;height:340px;border:1px solid gray" id="container"></div> <div style="float:left;width:200px;height:340px;border:1px solid gray;border-width:1px 1px 1px 0;padding:0 10px 0 0;line-height:1.8em;"> <ul> <li><a onMouseOver=openMyWin(infoWindow0,point[0]) href=#>张味记</a></li> <li><a onMouseOver=openMyWin(infoWindow1,point[1]) href=#>有意思餐饮</a></li> </ul> </div> </body> <script type="text/javascript"> var map = new BMap.Map("container"); var point = new BMap.Point(120.258449,28.809791); map.centerAndZoom(point, 14); map.enableScrollWheelZoom(); var myIcon = new BMap.Icon("http://dev.baidu.com/wiki/static/map/API/examples/images/Mario.png", new BMap.Size(32, 70), { imageOffset: new BMap.Size(0, 0) }); var point = [new BMap.Point(120.263767,28.805598),new BMap.Point(120.262415,28.815247),]; var marker0 = new BMap.Marker(point[0],{icon:myIcon}); var marker1 = new BMap.Marker(point[1],{icon:myIcon}); map.addOverlay(marker0); map.addOverlay(marker1); map.setViewport(point); var opts0 = {offset : new BMap.Size(0, -25), title : '<span style="font-size:14px;color:#0A8021">如家快捷酒店</span>'}; var opts1 = {offset : new BMap.Size(0, -25), title : '<span style="font-size:14px;color:#0A8021">如家快捷酒店</span>'}; var infoWindow0 = new BMap.InfoWindow("<div style=line-height:1.8em;font-size:12px;><b>地址:</b>北京</br></div>", opts0); var infoWindow1 = new BMap.InfoWindow("<div style=line-height:1.8em;font-size:12px;><b>地址:</b>北京市</br></div>", opts1); marker1.addEventListener("mouseover", function(){this.openInfoWindow(infoWindow1);}); marker0.addEventListener("mouseover", function(){this.openInfoWindow(infoWindow0);}); function openMyWin(id,p){ map.openInfoWindow(id,p); } </script>
var point = new BMap.Point(120.258449,28.809791); //多余,因为下面还有相同定义,
var point = [new BMap.Point(120.263767,28.805598),new BMap.Point(120.262415,28.815247),]; //错误,最后多了一个,
去掉var point = [new BMap.Point(120.263767,28.805598),new BMap.Point(120.262415,28.815247),];后面的 最后一个逗号!