I'm experiencing a fairly peculiar behavior - my RequireJS modules seem to be not initializing and running at all under 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 fine just as they should in Firefox/Chrome/Safari/etc. Cleaning browser cache and closing the developer tool in IE9 will render the JavaScript not running entirely again.
Another way to kick-start the execution of the RequireJS modules is to add a synchronous script calling before it:
<head>
...
<script type="text/javascript" src=".js"></script> // Add any synchronous script calling here and the module below will execute fine.
<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 scripts to launch before $.ready()
Why the developer tool can kick-start the execution really baffled me, though.
Looking for a full explanation to the phenomenon and how to solve it.
I'm experiencing a fairly peculiar behavior - my RequireJS modules seem to be not initializing and running at all under 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 fine just as they should in Firefox/Chrome/Safari/etc. Cleaning browser cache and closing the developer tool in IE9 will render the JavaScript not running entirely again.
Another way to kick-start the execution of the RequireJS modules is to add a synchronous script calling before it:
<head>
...
<script type="text/javascript" src="https://getfirebug./firebug-lite.js"></script> // Add any synchronous script calling here and the module below will execute fine.
<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 scripts to launch before $.ready()
Why the developer tool can kick-start the execution really baffled me, though.
Looking for a full explanation to the phenomenon and how to solve it.
Share Improve this question asked Oct 5, 2012 at 12:18 gskleegsklee 4,9444 gold badges41 silver badges56 bronze badges1 Answer
Reset to default 5Found the answer: console
is undefined
in IE9 when dev tool is not opened, but you never get to see this error since the tool's console requires a page reload to start working.
More details here: https://github./jrburke/requirejs/issues/488