0

So, I have a heavy page that does a ton of JavaScript and has some huge SVG elements. It's been working great in Webkit/Gecko, but I am now testing in IE and the page doesn't load (well, it loads but most of my JavaScript never seems to run).

First thing I did was drop Firebug Lite into the page to see what's happening, but after I did that, the page loads and functions perfectly in IE! However I don't see the little bug icon to get to the console.

Since I still don't have a console, I'm having trouble figuring out what's happening. Perhaps Firebug defined some variables (console?) that my page needed? Can anyone give some guidance on how to proceed here?

Tony R
  • 10,116
  • 21
  • 70
  • 100
  • A link or code would be helpful. – j08691 Feb 29 '12 at 19:33
  • 1
    IE has a built in console for 8 and beyond. Hit F12. :] – Snuffleupagus Feb 29 '12 at 19:33
  • @user1090190 WHAT?! How did I not know about this?! Is that a built-in equivalent for firebug and chrome's console? – Tony R Feb 29 '12 at 19:34
  • @TonyR It's definitely not as good as chrome's built in (no inspect element, no profiling tools) but it does indeed have a console, let you set breakpoints, view and manipulate the DOM etc. – Snuffleupagus Feb 29 '12 at 19:36
  • @j08691 Sorry, it's a huge page and is offline right now. I can't even go about forming a representative example because I have no console. Even the f12 console is not showing any console.log() messages... I'll keep trying things... – Tony R Feb 29 '12 at 19:38
  • 1
    Wait, are you saying you have uncommented console.log code when running in IE? If so, that would stop the script from running as IE chokes on it. – j08691 Feb 29 '12 at 19:39
  • @user1090190 Actually there IS a profiling tab, and there is a "Select element by click" feature under the Find menu =) – Tony R Feb 29 '12 at 19:40
  • So `console` is forbidden in IE? News to me.... Argh I hate IE... Although http://stackoverflow.com/questions/2656730/internet-explorer-console suggests that `console` is allowed. – Tony R Feb 29 '12 at 19:40

2 Answers2

2

I'll make this an answer since my comment seemed to solve your problem.

If you have uncommented console.log code when running in IE, IE will bark errors at you and fail to properly run the script. Opening a console (IE or Firebug Lite) typically allows the code to run, however you obviously cannot count on your visitors doing this, therefore it's always best to remove or comment out all console.log() calls when releasing production code.

j08691
  • 190,436
  • 28
  • 232
  • 252
0

Okay I think I figured this out. console is only defined in IE8+ IF the developer console has been opened and the page refreshed. So including Firebug Lite probably made my page work by itself defining console.

So I'll just have to comment out my console.log statements when the page is public.

halfer
  • 18,701
  • 13
  • 79
  • 158
Tony R
  • 10,116
  • 21
  • 70
  • 100