Viewing Javascript generated source?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul

    Viewing Javascript generated source?

    Hi all,

    I've a HTML page (self-authored!) which has a lot of embedded
    Javascript.

    View-source in any major browser I've tried (Konqueror, Opera,
    Mozilla, IE) shows the source code as retrieved from the HTTP server.
    Which is what you'd expect.

    Is it possible to view the source as generated by the Javascript, in
    the context of the page as a whole? So instead of seeing:

    <html>
    <body>
    <script>documen t.write("Hello World!");</script>
    </body>
    </html>

    I'd like to see:

    <html>
    <body>
    Hello World!
    </body>
    </html>

    Obviously, this is a contrived example. The Javascript in question
    uses conditional statements, and variables, so it's not merely a
    simple matter of reading the document.write( ) calls.

    Many thanks,
    Paul.
  • Andrew Graham

    #2
    Re: Viewing Javascript generated source?

    Paul wrote:[color=blue]
    > Hi all,
    >
    > View-source in any major browser I've tried (Konqueror, Opera,
    > Mozilla, IE) shows the source code as retrieved from the HTTP server.
    > Which is what you'd expect.
    >
    > Is it possible to view the source as generated by the Javascript, in
    > the context of the page as a whole?[/color]

    View source in Netscape 4.

    Andrew Graham


    Comment

    • Jane Withnolastname

      #3
      Re: Viewing Javascript generated source?

      On 14 Nov 2003 13:22:32 -0800, pgargan@orbism. com (Paul) wrote:
      [color=blue]
      >Hi all,
      >
      >I've a HTML page (self-authored!) which has a lot of embedded
      >Javascript.
      >
      >View-source in any major browser I've tried (Konqueror, Opera,
      >Mozilla, IE) shows the source code as retrieved from the HTTP server.
      >Which is what you'd expect.
      >
      >Is it possible to view the source as generated by the Javascript, in
      >the context of the page as a whole? So instead of seeing:
      >
      ><html>
      ><body>
      ><script>docume nt.write("Hello World!");</script>
      ></body>
      ></html>
      >
      >I'd like to see:
      >
      ><html>
      ><body>
      >Hello World!
      ></body>
      ></html>
      >[/color]

      I seem to remember browsers used to do that, but notice they don't
      anymore. I guess you gotta find an older version browser and do it....

      Comment

      • Anne van Kesteren

        #4
        Re: Viewing Javascript generated source?

        Jane Withnolastname wrote:[color=blue]
        > On 14 Nov 2003 13:22:32 -0800, pgargan@orbism. com (Paul) wrote:
        >
        >[color=green]
        >>Hi all,
        >>
        >>I've a HTML page (self-authored!) which has a lot of embedded
        >>Javascript.
        >>
        >>View-source in any major browser I've tried (Konqueror, Opera,
        >>Mozilla, IE) shows the source code as retrieved from the HTTP server.
        >>Which is what you'd expect.
        >>
        >>Is it possible to view the source as generated by the Javascript, in
        >>the context of the page as a whole? So instead of seeing:
        >>
        >><html>
        >><body>
        >><script>docum ent.write("Hell o World!");</script>
        >></body>
        >></html>
        >>
        >>I'd like to see:
        >>
        >><html>
        >><body>
        >>Hello World!
        >></body>
        >></html>
        >>[/color]
        >
        > I seem to remember browsers used to do that, but notice they don't
        > anymore. I guess you gotta find an older version browser and do it....[/color]
        Mozilla => "select all" => "right-click" => "view selection source"

        --
        Anne van Kesteren
        <http://www.annevankest eren.nl/>

        Comment

        • David Dorward

          #5
          Re: Viewing Javascript generated source?

          Paul wrote:
          [color=blue]
          > Is it possible to view the source as generated by the Javascript, in
          > the context of the page as a whole? So instead of seeing:[/color]

          Mozilla DOM Inspector can do it.

          --
          David Dorward http://dorward.me.uk/

          Comment

          • Mark Parnell

            #6
            Re: Viewing Javascript generated source?

            Sometime around 14 Nov 2003 13:22:32 -0800, Paul is reported to have
            stated:[color=blue]
            >
            > I've a HTML page (self-authored!) which has a lot of embedded
            > Javascript.
            >[/color]
            <snip>[color=blue]
            > Obviously, this is a contrived example. The Javascript in question
            > uses conditional statements, and variables, so it's not merely a
            > simple matter of reading the document.write( ) calls.[/color]

            I see others have given you various solutions, but the question still
            remains: why are you doing it with Javascript at all? You have a fallback
            for the ~15% who have Javascript disabled/unavailable, of course?

            Without a URI, I don't know what you are trying to achieve, but I would
            hazard a guess that server-side scripting would be a better solution. It
            would solve your problem of viewing the source, too.

            Either that or you may need to rethink the design.

            HTH

            --
            Mark Parnell

            Comment

            • Roland
              New Member
              • May 2006
              • 3

              #7
              Hello, you can see generated javascript source with the tracer tool

              A data processing company providing business information services, company documents and integration through corporate data API's


              It processes the page as the browser does, and traces every function. Check it

              Comment

              Working...