Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #9700 > unrolled thread

Viewing the Generated Page

Started byGene Wirchenko <genew@ocis.net>
First post2011-12-27 18:19 -0800
Last post2011-12-29 19:40 +0000
Articles 5 — 4 participants

Back to article view | Back to comp.lang.javascript


Contents

  Viewing the Generated Page Gene Wirchenko <genew@ocis.net> - 2011-12-27 18:19 -0800
    Re: Viewing the Generated Page Gene Wirchenko <genew@ocis.net> - 2011-12-27 18:22 -0800
      Re: Viewing the Generated Page Mentifex <mentifex@myuw.net> - 2011-12-27 19:06 -0800
    Re: Viewing the Generated Page "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-29 08:44 +0000
    Re: Viewing the Generated Page Dr J R Stockton <reply1152@merlyn.demon.co.uk> - 2011-12-29 19:40 +0000

#9700 — Viewing the Generated Page

FromGene Wirchenko <genew@ocis.net>
Date2011-12-27 18:19 -0800
SubjectViewing the Generated Page
Message-ID<05vkf7t9vfcps7dcil66bnqtdk33ua2ngv@4ax.com>
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

[toc] | [next] | [standalone]


#9701

FromGene Wirchenko <genew@ocis.net>
Date2011-12-27 18:22 -0800
Message-ID<4avkf71ko9ku1ecqo7qsjmf9oejb2tlecs@4ax.com>
In reply to#9700
On Tue, 27 Dec 2011 18:19:33 -0800, Gene Wirchenko <genew@ocis.net>
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

[toc] | [prev] | [next] | [standalone]


#9702

FromMentifex <mentifex@myuw.net>
Date2011-12-27 19:06 -0800
Message-ID<3d4017a9-df75-4404-a044-80ea47ef6faa@c42g2000prb.googlegroups.com>
In reply to#9701
On Dec 27, 6:22 pm, Gene Wirchenko <ge...@ocis.net> wrote:
> On Tue, 27 Dec 2011 18:19:33 -0800, Gene Wirchenko <ge...@ocis.net>
> 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

[toc] | [prev] | [next] | [standalone]


#9757

From"Evertjan." <exjxw.hannivoort@interxnl.net>
Date2011-12-29 08:44 +0000
Message-ID<Xns9FCA6309F9FA6eejj99@194.109.133.133>
In reply to#9700
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)

[toc] | [prev] | [next] | [standalone]


#9773

FromDr J R Stockton <reply1152@merlyn.demon.co.uk>
Date2011-12-29 19:40 +0000
Message-ID<msdmiVIyIM$OFw8m@invalid.uk.co.demon.merlyn.invalid>
In reply to#9700
In comp.lang.javascript message <05vkf7t9vfcps7dcil66bnqtdk33ua2ngv@4ax.
com>, Tue, 27 Dec 2011 18:19:33, Gene Wirchenko <genew@ocis.net> 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>.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web