Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   Javascript output code in Netscape 7x and IE 6x (http://www.velocityreviews.com/forums/t875545-javascript-output-code-in-netscape-7x-and-ie-6x.html)

Albert Spencil 02-01-2004 06:27 AM

Javascript output code in Netscape 7x and IE 6x
 
It once was necessary to type "view-source" before the URL in Location
to view the javascript original coding for Netscape. The default was
the output code of
the script. Now the default is the original script code. Is there a
way to see the original coding in Netscape 7x and/or IE 6x without
falling back to an old version of NS ?

That is,when I "view source" I want to see:

<body>
Most cats have fur
</body>

Rather than:

<body>
<script language='javascript'>
var message='Most cats have fur';
document.write(message);
</script>
</body>

Martin Honnen 02-01-2004 01:41 PM

Re: Javascript output code in Netscape 7x and IE 6x
 


Albert Spencil wrote:
> It once was necessary to type "view-source" before the URL in Location
> to view the javascript original coding for Netscape. The default was
> the output code of
> the script. Now the default is the original script code. Is there a
> way to see the original coding in Netscape 7x and/or IE 6x without
> falling back to an old version of NS ?
>
> That is,when I "view source" I want to see:
>
> <body>
> Most cats have fur
> </body>
>
> Rather than:
>
> <body>
> <script language='javascript'>
> var message='Most cats have fur';
> document.write(message);
> </script>
> </body>


With Netscape 7.1 or Mozilla you can use Ctrl-A to select all the
displayed page content and then use view selection source in the context
menu, you will get the both the script elements and the output they have
produced that way.
Netscape/Mozilla also have the DOM inspector which doesn't show
serialized source code but a tree view of the document which is very
helpful. Again you will see both a script elements and its output in
that view.

For IE you could use a bookmarklet e.g.
javascript: alert(document.documentElement.outerHTML); void 0

Of course with both browsers dynamic manipulation of the document is
possible without using document.write and even after the page has been
loaded so what the above ways show is a current snapshot.
--

Martin Honnen
http://JavaScript.FAQTs.com/


Albert Spencil 02-01-2004 08:16 PM

Re: Javascript output code in Netscape 7x and IE 6x
 
Martin Honnen <mahotrash@yahoo.de> wrote in message news:<401d01f9$1@olaf.komtel.net>...

>
> With Netscape 7.1 or Mozilla you can use Ctrl-A to select all the
> displayed page content and then use view selection source in the context
> menu, you will get the both the script elements and the output they have
> produced that way.
> Netscape/Mozilla also have the DOM inspector which doesn't show
> serialized source code but a tree view of the document which is very
> helpful. Again you will see both a script elements and its output in
> that view.
>
> For IE you could use a bookmarklet e.g.
> javascript: alert(document.documentElement.outerHTML); void 0
>
> Of course with both browsers dynamic manipulation of the document is
> possible without using document.write and even after the page has been
> loaded so what the above ways show is a current snapshot.


"View selection source" did the job for Netscape 7.1 . "javascript:
alert(document.documentElement.outerHTML); void 0" for IE6x gave me a
page with only the top part of the source and had no scrollbar. How
do I see the entire source with the latter??
Thanks!!!
Albert Spencil

Randy Webb 02-01-2004 08:54 PM

Re: Javascript output code in Netscape 7x and IE 6x
 
Albert Spencil wrote:

> Martin Honnen <mahotrash@yahoo.de> wrote in message news:<401d01f9$1@olaf.komtel.net>...
>
>


<--snip-->

> "View selection source" did the job for Netscape 7.1 . "javascript:
> alert(document.documentElement.outerHTML); void 0" for IE6x gave me a
> page with only the top part of the source and had no scrollbar. How
> do I see the entire source with the latter??


javascript:window.clipboardData.setData('text',doc ument.documentElement.innerHTML);void%200

And then paste it into a text editor. There are other ways to get it,
but that seems to be the easiest.

Put a textarea on the page, set its value to
document.documentElement.innerHTML and scroll down.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/



All times are GMT. The time now is 08:37 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.