node.js - How to Debug a JavaScript code when it is loaded by document.write? -


i can see code in element view in chrome, not in source because load document.write function.

how set breakpoint in case?

i suppose have access source code generates document.write, can add call 'debugger' this:

<script> document.write('<sc' + 'ript> debugger; alert(0);</s' + 'cript>'); </script> 

i have debugger opened on chrome, stop execution , show generated code on sources tab.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -