get html generated by javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • quikquic@yahoo.com

    get html generated by javascript

    If there is javascript in a html file, for example,

    <html>
    <body>
    <script language="JavaS cript">
    document.write( "Hello");
    </script>
    </body>
    </html>

    How can I can get the pure html generate by javascript,

    <html>
    <body>
    Hello
    </body>
    </html>

    I am looking for a c++ solution.

    Thanks, qk
  • Brian

    #2
    Re: get html generated by javascript

    quikquic@yahoo. com wrote:[color=blue]
    > If there is javascript in a html file, for example,
    >
    > <html>
    > <body>
    > <script language="JavaS cript">
    > document.write( "Hello");
    > </script>
    > </body>
    > </html>
    >
    > How can I can get the pure html generate by javascript,
    >
    > <html>
    > <body>
    > Hello
    > </body>
    > </html>[/color]

    <script language="JavaS cript">
    document.write( '<html>');
    document.write( '<body>');

    etc.
    [color=blue]
    > I am looking for a c++ solution.[/color]

    I don't get this part.

    --
    Brian
    follow the directions in my address to email me

    Comment

    • David Dorward

      #3
      Re: get html generated by javascript

      quikquic@yahoo. com wrote something that suggests he should read:



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

      Comment

      • Stephen Poley

        #4
        Re: get html generated by javascript

        On Thu, 18 Sep 2003 23:34:49 GMT, Brian
        <usenet1@mangym utt.com.invalid-remove-this-part> wrote:
        [color=blue]
        >quikquic@yahoo .com wrote:[color=green]
        >> If there is javascript in a html file, for example,
        >>
        >> <html>
        >> <body>
        >> <script language="JavaS cript">
        >> document.write( "Hello");
        >> </script>
        >> </body>
        >> </html>
        >>
        >> How can I can get the pure html generate by javascript,
        >>
        >> <html>
        >> <body>
        >> Hello
        >> </body>
        >> </html>[/color][/color]
        [color=blue]
        ><script language="JavaS cript">
        >document.write ('<html>');
        >document.write ('<body>');[/color]

        But is that a good idea? It means that someone without Javascript will
        get a totally blank page. It seems to me a minimum requirement that
        someone without Javascript at least gets a message pointing out that
        Javascript is required for the page in question.

        And in approximately 99% of cases a page can actually be rendered quite
        acceptably without Javascript at all, if sensibly written, as the
        Javascript is usually only used for a bit of decoration, and not for the
        true content of the page at all. So the OP's first approach is the write
        way ... er sorry, right way to go about it.

        --
        Stephen Poley


        Comment

        • Jonathan Snook

          #5
          Re: get html generated by javascript

          "Stephen Poley" <sbpoley@xs4all .nl> wrote in message
          news:m9almv804d eutp55nqomonsjk app1uof4t@4ax.c om...[color=blue][color=green]
          > ><script language="JavaS cript">
          > >document.write ('<html>');
          > >document.write ('<body>');[/color][/color]

          I took the OP message to mean: "how can I access the final generated HTML?"

          If you're using IE, my thought is you could try copying the innerHTML of the
          documentElement to the clipboardData object once the page has loaded. Check
          out the following URL for more information on clipboardData, etc:


          Jonathan



          Comment

          • Kris

            #6
            Re: get html generated by javascript

            In article
            <ikBab.41615$Ch 2.16040@news02. bloor.is.net.ca ble.rogers.com> ,
            "Jonathan Snook" <goto_www.snook .ca@snook.ca> wrote:
            [color=blue][color=green][color=darkred]
            > > ><script language="JavaS cript">
            > > >document.write ('<html>');
            > > >document.write ('<body>');[/color][/color]
            >
            > I took the OP message to mean: "how can I access the final generated HTML?"
            >
            > If you're using IE, my thought is you could try copying the innerHTML of the
            > documentElement to the clipboardData object once the page has loaded. Check
            > out the following URL for more information on clipboardData, etc:
            > http://msdn.microsoft.com/library/de...or/dhtml/refer
            > ence/dhtml_reference _entry.asp[/color]

            The Document Object Model and ECMAscript are your friends. Edgy stuff
            though.

            --
            Kris
            kristiaan@xs4al l.netherlands (nl)

            Comment

            • Brian

              #7
              Re: get html generated by javascript

              Stephen Poley wrote:[color=blue]
              > On Thu, 18 Sep 2003 23:34:49 GMT, Brian
              > <usenet1@mangym utt.com.invalid-remove-this-part> wrote:
              >[color=green]
              >><script language="JavaS cript">
              >>document.writ e('<html>');
              >>document.writ e('<body>');[/color]
              >
              > But is that a good idea?[/color]

              I did not comment on the wisdom of it. ;-) And the op didn't explain
              the context.
              [color=blue]
              > It means that someone without Javascript will get a totally blank page.[/color]

              I have used that idea with a safe fallback on a photography site.
              Briefly: thumnail photo is an anchor to the full-sized photo, with an
              onclick event that creates a new html document, writes the html,
              writes in that document an image tag with the large photo, and returns
              false. If js is enabled, visitor gets a framed photo. If not,
              visitor gets photo in window, by itself, in upper left corner.

              --
              Brian
              follow the directions in my address to email me

              Comment

              • Stephen Poley

                #8
                Re: get html generated by javascript

                On Fri, 19 Sep 2003 10:59:26 GMT, "Jonathan Snook"
                <goto_www.snook .ca@snook.ca> wrote:
                [color=blue]
                >"Stephen Poley" <sbpoley@xs4all .nl> wrote in message
                >news:m9almv804 deutp55nqomonsj kapp1uof4t@4ax. com...[color=green][color=darkred]
                >> ><script language="JavaS cript">
                >> >document.write ('<html>');
                >> >document.write ('<body>');[/color][/color]
                >
                >I took the OP message to mean: "how can I access the final generated HTML?"[/color]

                After re-reading it, I think you're right.

                --
                Stephen Poley


                Comment

                Working...