0

I have a page at zackel.com that doesn't start up with IE9 unless you first hit F12 to start the debugger and then do a refresh.

To see the problem go to zackel.com, login in upper right as email= guest@comcast.net Password= guest and select GALLERY.

This should display the gallery images and works for IE10, IE11, Chrome, FF, etc. On IE9 nothing happens until you hit F12 and then refresh the browser. Then GALLERY shows the gallery images.

Does anyone know what could be going on?

Thanks

Steve
  • 4,534
  • 9
  • 52
  • 110
  • 1
    possible duplicate of [Why Javascript only works after opening developer tools in IE once?](http://stackoverflow.com/questions/7742781/why-javascript-only-works-after-opening-developer-tools-in-ie-once) – Spudley Jun 28 '14 at 20:42

1 Answers1

2

I remember having a similar problem last year.

It is indeed strange. It seems to be caused by calls to console.log. In IE9 console.log is only defined when the developer tools are open. That seems to explain why you have to press F12 and do a refresh and then it works.

In this question the situation is explained better: Does IE9 support console.log, and is it a real function?

What helped was either to remove all calls to console.log or defining console.log when its undefined like explained in this answer to the question above: https://stackoverflow.com/a/9593812/669561

if (!window.console) window.console = {};
if (!window.console.log) window.console.log = function () { };

This solution seems to be even better: https://stackoverflow.com/a/11147595/669561

I hope it helps!

Community
  • 1
  • 1
DanEEStar
  • 6,140
  • 6
  • 37
  • 52