Viewing the Generated Page

Discussion in 'Javascript' started by Gene Wirchenko, Dec 28, 2011.

  1. Dear JavaScripters:

    How do I view the generated page? I do not mean the source, but
    the result of the source. I could -- read as "quite probably do" --
    have errors in my JavaScript, and it would be easier if I could see
    what page has resulted from my code.

    Sincerely,

    Gene Wirchenko
    Gene Wirchenko, Dec 28, 2011
    #1
    1. Advertising

  2. On Tue, 27 Dec 2011 18:19:33 -0800, Gene Wirchenko <>
    wrote:

    >Dear JavaScripters:
    >
    > How do I view the generated page? I do not mean the source, but
    >the result of the source. I could -- read as "quite probably do" --
    >have errors in my JavaScript, and it would be easier if I could see
    >what page has resulted from my code.


    I am using IE 9.

    Sincerely,

    Gene Wirchenko
    Gene Wirchenko, Dec 28, 2011
    #2
    1. Advertising

  3. Gene Wirchenko

    Mentifex Guest

    On Dec 27, 6:22 pm, Gene Wirchenko <> wrote:
    > On Tue, 27 Dec 2011 18:19:33 -0800, Gene Wirchenko <>
    > wrote: [...]
    > >     How do I view the generated page? [...]

    >      I am using IE 9.


    You could do it the same way I do coding

    http://wwww.scn.org/~mentifex/Dushka.html

    as a Russian-thinking artificial AI Mind.
    Namely, on your computer you keep Internet
    Explorer open in one window to hold the
    "generated page", and you keep the JavaScript
    source code open in another window for editing.

    MSIE only seems to refresh the "generated page"
    properly when you have "saved" the source code
    with at least one change made to it. Then you
    click on Refresh at the top of the browser,
    and it renders the generated page for you.

    Hope this helps.

    Mentifex (Arthur)
    --
    http://www.scn.org/~mentifex/AiMind.html
    http://www.chatbots.org/ai_zone/viewthread/240/
    http://freerussiankeyboard.org/links/index.html
    http://cyborg.blogspot.com/2009/08/javascript.html
    Mentifex, Dec 28, 2011
    #3
  4. Gene Wirchenko

    Evertjan. Guest

    Gene Wirchenko wrote on 28 dec 2011 in comp.lang.javascript:

    > How do I view the generated page? I do not mean the source, but
    > the result of the source. I could -- read as "quite probably do" --
    > have errors in my JavaScript, and it would be easier if I could see
    > what page has resulted from my code.
    >


    Using Chrome and Shortcut Manager,
    I use the below under Ctrl-A10,
    showing the effective/dynamic html of a selected range,
    first in a confirm() box,
    and if confirmed at the page bottom for copying:

    ===============================================

    function getSelectedHTML(){
    var rng=null,html="";
    rng=window.getSelection();
    if (rng.rangeCount > 0 && window.XMLSerializer){
    rng=rng.getRangeAt(0);
    html=new XMLSerializer().serializeToString(rng.cloneContents());
    };
    return html;
    };

    var x = getSelectedHTML()

    if (confirm( x +'\n\n[Send a copy to the bottom of this page?]') ){
    var tempNode = document.createElement('div');
    tempNode.style.border='black 2px solid';
    tempNode.style.backgroundColor='#eee';
    tempNode.style.width='800px';
    tempNode.style.padding='20px';
    tempNode.style.margin='20px 20px 200px 100px ';
    tempNode.innerHTML = x.replace(/</g,'<br>&lt;');
    document.body.appendChild(tempNode);
    };

    ==============================================



    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Dec 29, 2011
    #4
  5. In comp.lang.javascript message <05vkf7t9vfcps7dcil66bnqtdk33ua2ngv@4ax.
    com>, Tue, 27 Dec 2011 18:19:33, Gene Wirchenko <> posted:

    > How do I view the generated page? I do not mean the source, but
    >the result of the source. I could -- read as "quite probably do" --
    >have errors in my JavaScript, and it would be easier if I could see
    >what page has resulted from my code.



    Ocularly.

    You should say what sort of system you are using, in case it matters.

    Remember that your operating system is almost certainly not called
    "Window".

    I just edit the source file (in PFE, at top left) and have a browser
    (generally Firefox, not maximised, top right) open. An incantation such
    as file:///C:/wsh/seek/seakfyle.htm#elsewhere can be entered in the
    address bar. All my browsers can read that, though Opera replaces it
    with file://localhost/C:/HOMEPAGE/FREQUENT.HTM which Firefox can
    read ...

    You can also go via "My Computer", find the desired HTM or HTML file,
    and double-click on it.

    Then I cycle through Edit, Save, refresh browser, as nauseam.

    Opera allows the reader to edit the "view Source" of the page being
    viewed, and view or save it. Using that, you ___could__ edit in Opera,
    check-view in Opera, save, and real-test in IE.

    For some testing, it is better to use the page from your real ultimate
    public web server. Generally, AIUI, instead of that, one can install a
    private server on one's local computer.

    But you should not, I think, think that there is _necessarily_ within
    the displaying machine an HTML version of what is seen. If you code

    <p>para1</p> <p>para1</p>
    <p ID=GW></p> it looks like <p>para2</p>
    <p>para3</p> <p>para3</p>

    after executing documemt.getElementById("GW").innerHTML = "para2"

    but the displayed object is a tree structure of DOM elements rooted in
    the document object (which is apparently parentless). Play with
    <http://www.merlyn.demon.co.uk/js-props.htm#F> and, possibly aided by
    the instructions, you will see that.

    You may find that setting a textarea's value to document.body.innerHTML
    shows what you want to see.

    For "scratchpad" tests, I use a local copy of
    <http://www.merlyn.demon.co.uk/js-quick.htm>.

    You can write the results of your script to, say, a textarea as well as
    into, say, the target <DIV>.

    But it's not at all clear to me where your difficulty arises.

    --
    (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike 6.05 WinXP.
    Web <http://www.merlyn.demon.co.uk/> - FAQ-type topics, acronyms, and links.
    Command-prompt MiniTrue is useful for viewing/searching/altering files. Free,
    DOS/Win/UNIX now 2.0.6; see <URL:http://www.merlyn.demon.co.uk/pc-links.htm>.
    Dr J R Stockton, Dec 29, 2011
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Petter

    Problems Viewing Web Page

    Jeff Petter, Aug 28, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    334
    Jeff Petter
    Aug 28, 2003
  2. John Hamm
    Replies:
    0
    Views:
    396
    John Hamm
    Nov 19, 2003
  3. Tony Moaikel

    Viewing generated code in ASP.NET

    Tony Moaikel, Nov 9, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    475
    Juan T. Llibre
    Nov 9, 2005
  4. Tim Flynn

    viewing generated images

    Tim Flynn, Jun 2, 2005, in forum: Python
    Replies:
    2
    Views:
    612
    Tim Flynn
    Jun 2, 2005
  5. Neil Morris

    viewing javascript generated html code

    Neil Morris, Sep 21, 2003, in forum: Javascript
    Replies:
    1
    Views:
    115
    Martin Honnen
    Sep 21, 2003
Loading...

Share This Page