HowTo save or view ynamically generated HTML

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

    #1

    HowTo save or view ynamically generated HTML

    Hi All:
    I'm working on a javascript that dynamically generates html.

    Example
    Html code contains a select element. An event handler in the body tag
    adds option items to the select element.

    In netscape I can view only the "hard-coded" html code, but not the
    auto-generated code.

    Is there a way to see the auto-generated code?

    TIA
    Tim
  • YD

    #2
    Re: HowTo save or view ynamically generated HTML

    Tim Johnson a écrit :
    [color=blue]
    > In netscape I can view only the "hard-coded" html code, but not the
    > auto-generated code.
    >
    > Is there a way to see the auto-generated code?[/color]

    You may use this function in recent browsers :

    function popupGeneratedH TML(){
    if(document.doc umentElement && document.docume ntElement.inner HTML){
    var a=document.docu mentElement.inn erHTML;
    a=a.replace(/</g,'&lt;');
    var w=window.open() ;
    w.document.open ();
    w.document.writ e('<pre>&lt;HTM L>\n'+a+'\n&lt ;/HTML></pre>');
    w.document.clos e();
    }
    }

    HTH

    --
    Y.D.

    Comment

    Working...