IE9在使用开发人员工具时是否启用“某些”功能? [英] Does IE9 enable 'something' when using developer tools?

查看:78
本文介绍了IE9在使用开发人员工具时是否启用“某些”功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Google Maps Javascript API V3,最近我的地图上的图标没有出现在IE9中。



要深入了解它,我开启了IE的开发者工具。当我刷新地图时,图标出现了!但是,当我关闭IE并重新开始时,图标不存在。



我的问题是本主题的标题,访问IE开发人员工具时启用的内容,它允许我的Google地图上的图标显示出来??如果你的代码中有任何控制台打印的话,如果在开发人员工具关闭时加载页面,则会抛出异常(因此会在后面打破JavaScript)。



解决此问题,将打印件打包在if语句中:

  if(console){
console.log('...');
}


Im using Google Maps Javascript API V3, and recently the icons on my map aren't showing up in IE9.

To get to the bottom of it, I turned on IE's developer tools. When I refreshed the map, the icons appeared! However, when I close out of IE and start anew, the icons aren't there. Yet again, if I turn on the developer tools and refresh, the icons appear.

My question is the title of this topic, what is enabled when accessing IE's developer tools, which is allowing my icons on my Google map to appear??

解决方案

If you have any console prints in your code, these would throw exceptions (hence breaking the javascript after it) if the page was loaded when the developer tools were closed.

to fix this, wrap your prints in an if statement:

if (console) {
   console.log('...');
}

这篇关于IE9在使用开发人员工具时是否启用“某些”功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆