Search code examples
javascriptinternet-explorer-11

Javascript is not loaded in IE11 unless compatibility modes is turned on or off


Situation

I maintain a webpage which uses Javascript to wrap a list of pictures into a slider.

The customer reported that the slider isn't loaded on IE11 (11.0.9600) unless put into compatibility mode. (As it seems the responsible Javascript isn't loaded or executed.)

Analysis

I couldn't recreate this problem on or virtual machines at all. But during a TeamViewer-session with the customer I was able to witness the following behavior:

  1. Opening subpage with images
    => Slider is not initialized
  2. Adding current domain to list of sites in compatibility mode
    => Page reloads and Slider is initialized

Strange enough, but here is more:

  1. Loading another subpage (same domain) with images
    => Slider isn't initialized (again)
  2. Remove the current domain to list of sites in compatibility mode
    => Page reloads and Slider is initialized

So it is not the compatibility mode itself causing or fixing the error, but switching in on or off.

Question

The customer asks to fix that error serverside. But I have not a clue what might going on there. And since I can't recreate the error locally it's even harder to debug.

Also I'm unsure if there is anything I can do serverside.

Does anyone have any clue what might be going on?


Solution

  • Ok, I found the problem:

    there was a call of new URL(...) in the Javascript which isn't supported by the IE. That basically stopped the execution of the script including the initialization of he slider.

    To why I wasn't able to recreate the issue locally:
    The call above got executed only under certain circumstances like a specific browsing path. Really messed up.