View Code Written by "document.write"?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jack3000

    View Code Written by "document.write"?

    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!
  • Lasse Reichstein Nielsen

    #2
    Re: View Code Written by "document. write"?

    mr_nice_1973@ya hoo.com (Jack3000) writes:
    [color=blue]
    > 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.[/color]

    You can enter this URL at the command line, or keep it as a bookmarklet:
    javascript:(doc ument.documentE lement||documen t.body).innerHT ML.replace(/&/g,"&amp;").repl ace(/</g,"&lt;").repla ce(/\n/g,"<br>")

    Only works in browsers that support innerHTML.
    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • Ivo

      #3
      Re: View Code Written by &quot;document. write&quot;?

      "Lasse Reichstein Nielsen" <lrn@hotpop.com > wrote in message
      news:wu0c3w34.f sf@hotpop.com.. .[color=blue]
      >
      > You can enter this URL at the command line, or keep it as a bookmarklet:
      >[/color]
      javascript:(doc ument.documentE lement||documen t.body).innerHT ML.replace(/&/g,
      "&amp;").replac e(/</g,"&lt;").repla ce(/\n/g,"<br>")[color=blue]
      >
      > Only works in browsers that support innerHTML.
      > /L[/color]

      Very nice. You can even have linenumbers with that:
      javascript:'<co de><ol><li>'+(d ocument.documen tElement||docum ent.body).outer H
      TML.replace(/&/g,"&amp;").repl ace(/</g,"&lt;").repla ce(/%20%20/g,"&nbsp;%20"
      ).replace(/\n/g,"<li>")+'<\/ol><\/code>';

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


      Comment

      Working...