问题
Here is the simplest example I could come up with. I keep getting an Invalid Argument exception being thrown on the second require call in IE7 and IE8. This works fine in IE9+, Chrome and Firefox. Very frustrating. Debugging this through IE developer tools has not been helpful.
<script type="text/javascript">
require(["dojo/request/xhr", "dojo/domReady"],
function(xhr){
xhr("Servlet?arg=1")
.then(function(data) {
try {
test()
} catch(e) {
cpb.consoleLog(e.number);
cpb.consoleLog(e.description);
throw e;
}
});
});
function test() {
require(['dojox/charting/Chart'], function (Chart) {
// simulate problem
});
}
</script>
来源:https://stackoverflow.com/questions/13074513/dojo-nested-requires-on-ie7-and-ie8-causes-invalid-argument-exception