admin管理员组文章数量:1026390
I am attempting to debug a page issue where IE 9 will work the first time on my requirejs/backbone application, but will fail on the page reload. However, when I attempt to debug this problem using the f12 IE developer tools, I cannot navigate to the source to set a breakpoint because IE does not load any of the files that RequireJS includes. How can I get around this issue to fix my IE headache??
I am attempting to debug a page issue where IE 9 will work the first time on my requirejs/backbone application, but will fail on the page reload. However, when I attempt to debug this problem using the f12 IE developer tools, I cannot navigate to the source to set a breakpoint because IE does not load any of the files that RequireJS includes. How can I get around this issue to fix my IE headache??
Share Improve this question asked Feb 21, 2013 at 17:45 Matt BroekhuisMatt Broekhuis 2,0753 gold badges29 silver badges35 bronze badges 2- 2 Does clicking the refresh icon in the HTML tab make a difference? – epascarello Commented Feb 21, 2013 at 17:47
- It does refresh all the script tags that requirejs has written to the dom in the HTML view. However, the script tab does not reflect these new scripts (can't see them) – Matt Broekhuis Commented Feb 22, 2013 at 16:36
3 Answers
Reset to default 4I guess I am late for the party but hope my answer helps you and others as well.
The file that you want to debug or the line in the file, simply add this --> debugger;
before that line.
So, when require.js loads your script and encounter that string i.e. debugger;
exists it will automatically be stopped at that line.
You can generate a single js File with require tools :
- include requirejs in this single file (http://requirejs/docs/optimization.html#onejs)
- set optimise to none (no source minified - http://requirejs/docs/optimization.html#shallow)
In your index.html link this file instead of require.js.
You can debug with IE.
I have the same problem from time to time. What sometimes helps: Close all the files in Debugger view, leave the DevTools open, press Play to allow page to continue and then make your action on the page or reload - if it halts on the debugger; again, all the files will be loaded. But still investigating ;)
I am attempting to debug a page issue where IE 9 will work the first time on my requirejs/backbone application, but will fail on the page reload. However, when I attempt to debug this problem using the f12 IE developer tools, I cannot navigate to the source to set a breakpoint because IE does not load any of the files that RequireJS includes. How can I get around this issue to fix my IE headache??
I am attempting to debug a page issue where IE 9 will work the first time on my requirejs/backbone application, but will fail on the page reload. However, when I attempt to debug this problem using the f12 IE developer tools, I cannot navigate to the source to set a breakpoint because IE does not load any of the files that RequireJS includes. How can I get around this issue to fix my IE headache??
Share Improve this question asked Feb 21, 2013 at 17:45 Matt BroekhuisMatt Broekhuis 2,0753 gold badges29 silver badges35 bronze badges 2- 2 Does clicking the refresh icon in the HTML tab make a difference? – epascarello Commented Feb 21, 2013 at 17:47
- It does refresh all the script tags that requirejs has written to the dom in the HTML view. However, the script tab does not reflect these new scripts (can't see them) – Matt Broekhuis Commented Feb 22, 2013 at 16:36
3 Answers
Reset to default 4I guess I am late for the party but hope my answer helps you and others as well.
The file that you want to debug or the line in the file, simply add this --> debugger;
before that line.
So, when require.js loads your script and encounter that string i.e. debugger;
exists it will automatically be stopped at that line.
You can generate a single js File with require tools :
- include requirejs in this single file (http://requirejs/docs/optimization.html#onejs)
- set optimise to none (no source minified - http://requirejs/docs/optimization.html#shallow)
In your index.html link this file instead of require.js.
You can debug with IE.
I have the same problem from time to time. What sometimes helps: Close all the files in Debugger view, leave the DevTools open, press Play to allow page to continue and then make your action on the page or reload - if it halts on the debugger; again, all the files will be loaded. But still investigating ;)
本文标签: javascriptInternet Explorer Developer Tools does not show source code using RequireJSStack Overflow
版权声明:本文标题:javascript - Internet Explorer Developer Tools does not show source code using RequireJS - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745640256a2160703.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论