View Code Written by "document.write"?

J

Jack3000

Is there anyway to view what is written when using document.write?

When I view the source from the webbrowser, I don't see the code that
is written after the browser performs the document.write action.

Many thanks!
 
L

Lasse Reichstein Nielsen

Is there anyway to view what is written when using document.write?

When I view the source from the webbrowser, I don't see the code that
is written after the browser performs the document.write action.

You can enter this URL at the command line, or keep it as a bookmarklet:
javascript:(document.documentElement||document.body).innerHTML.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\n/g,"<br>")

Only works in browsers that support innerHTML.
/L
 
I

Ivo

Lasse Reichstein Nielsen said:
You can enter this URL at the command line, or keep it as a bookmarklet:
javascript:(document.documentElement||document.body).innerHTML.replace(/&/g,
&amp;").replace(/ said:
Only works in browsers that support innerHTML.
/L

Very nice. You can even have linenumbers with that:
javascript:'<code><ol><li>'+(document.documentElement||document.body).outerH
TML.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/%20%20/g,"&nbsp;%20"
).replace(/\n/g,"<li>")+'<\/ol><\/code>';

and browsers that support outerHTML give you that one more tag.)
--I
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,829
Latest member
PIXThurman

Latest Threads

Top