467,143 Members | 1,223 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,143 developers. It's quick & easy.

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>
Jul 20 '05 #1
  • viewed: 2846
Share:
3 Replies


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/

Jul 20 '05 #2
Martin Honnen <ma*******@yahoo.de> wrote in message news:<40********@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
Jul 20 '05 #3
Albert Spencil wrote:
Martin Honnen <ma*******@yahoo.de> wrote in message news:<40********@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/

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.