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

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

Ansible warning on jinja2 braces on when -

html - How to custom Bootstrap grid height? -