Javascript output code in Netscape 7x and IE 6x

A

Albert Spencil

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>
 
M

Martin Honnen

Albert said:
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.
 
A

Albert Spencil

Martin Honnen said:
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
 
R

Randy Webb

"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',document.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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top