javascript - RequireJS not working in IE9 - Stack Overflow

I'm experiencing a fairly peculiar behavior - my RequireJS modules seem to be not initializing and

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 badges
Add a ment  | 

1 Answer 1

Reset to default 5

Found 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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745140756a4613420.html

相关推荐

  • javascript - RequireJS not working in IE9 - Stack Overflow

    I'm experiencing a fairly peculiar behavior - my RequireJS modules seem to be not initializing and

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信