Reputation: 35
I can see the code in Element view in Chrome, but not in source because it is load by document.write
function.
How do I set a breakpoint in this case?
Upvotes: 1
Views: 324
Reputation: 381
I suppose you have access to the source code that generates the document.write, you can add a call to the 'debugger' like this:
<script>
document.write('<sc' + 'ript> debugger; alert(0);</s' + 'cript>');
</script>
I you have the debugger opened on chrome, it will stop the execution and show the generated code on the Sources tab.
Upvotes: 2