<script type="text/javascript">
function initialize() {
var markers = JSON.parse('[{"title":"Chennai","lat":"12.897400","lng":"80.288000","Description":"welcome to chennai"},{"title":"Hyderabad","lat":"17.266700","lng":"78.530200","Description":"welcome to hyderabad"},{"title":"Banglore","lat":"12.897400","lng":"77.519500","Description":"welcome to Banglore"},{"title":"vishkapatnam","lat":"17.518300","lng":"83.320300","Description":"welcome to Vishkapatnam"}]');
var mapOptions = {
center: new google.maps.LatLng(markers[0].lat, markers[0].lng),
zoom: 5,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
我收到的 JSON 未找到 Microsoft?那么我该怎么办?
最佳答案
检查您是否处于兼容模式。 您可以通过元标记确保 IE8 不会在 IE7 模式下呈现
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
或者最好使用文档类型
<!DOCTYPE html>
关于javascript - IE 兼容模式下未定义 JSON 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19023633/