Javascript output code in Netscape 7x and IE 6x

Discussion in 'Javascript' started by Albert Spencil, Feb 1, 2004.

  1. 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>
     
    Albert Spencil, Feb 1, 2004
    #1
    1. Advertising

  2. 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/
     
    Martin Honnen, Feb 1, 2004
    #2
    1. Advertising

  3. Martin Honnen <> wrote in message news:<401d01f9$>...

    >
    > 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
     
    Albert Spencil, Feb 1, 2004
    #3
  4. Albert Spencil

    Randy Webb Guest

    Albert Spencil wrote:

    > Martin Honnen <> wrote in message news:<401d01f9$>...
    >
    >


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

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/
     
    Randy Webb, Feb 1, 2004
    #4
    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. Tom
    Replies:
    0
    Views:
    510
  2. Mickey Segal
    Replies:
    1
    Views:
    689
    Mickey Segal
    May 21, 2004
  3. yaktipper
    Replies:
    10
    Views:
    304
    Richard Cornford
    Jul 10, 2003
  4. SabMan
    Replies:
    2
    Views:
    123
    Lasse Reichstein Nielsen
    Dec 6, 2003
  5. John
    Replies:
    1
    Views:
    110
Loading...

Share This Page