Not working in IE9 #488

Closed
gsklee opened this Issue Oct 5, 2012 · 2 comments

2 participants

@gsklee

I'm experiencing a fairly peculiar behavior - my RequireJS modules seem to be not initializing and running at all in IE9:

    <head>
        ...
        <script data-main="/static/js/main" src="/static/js/libs/require.js"></script> // Seems to be not running at all.
    </head>

However, whenever I fire up IE9's developer tool, and reload the page, the modules will be running just fine as they should in Firefox/Chrome/Safari/etc. Cleaning browser cache and closing the developer tool will again render the JavaScript not running entirely.

Another way to kick-start the execution of the modules seems to be adding a synchronous script calling before it:

    <head>
        ...
        <script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script> // Adds a synchronous script calling here and the modules below will execute.
        <script data-main="/static/js/main" src="/static/js/libs/require.js"></script>
    </head>

It would appear that the reason of the weird behavior may either be:

  • Something went wrong with RequireJS' async loading
  • Something went wrong that caused the scripts to run before DOM is ready

Why the developer tool can kick-start it really baffled me though.

Looking for a way to solve it, and perhaps an explanation to this weird phenomenon.

@jrburke
requirejs member

This normally means the HTML page or a piece of javascript has a console.log() or some console.* call in it. When the developer tools are opened, it defines console, but when it is closed, it does not exist.

So I would start by looking for that. I'm going to close this as I expect that is the issue, but we can reopen later if we find an issue.

@jrburke jrburke closed this Oct 6, 2012
@gsklee

That, sir, was exactly the source of the issue! Turned out it's another stupidity on IE's part... Thank you very much for your insight =D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment