How do I get HTML sent to server?

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

    #1

    How do I get HTML sent to server?

    Hey,

    I have a need to get HTML from a client back to a server to do server
    processing. I would like the HTML and form data both. Is there a simple way
    to capture that? I do not want to submit the page...I will use ajax to send
    the data.

    I know how to get the elements but not the entire page or form. I am really
    just interested in specifying document.form2 and sending that.

    Thanks,
    Mica


  • SAM

    #2
    Re: How do I get HTML sent to server?

    MC a écrit :
    Hey,
    >
    I have a need to get HTML from a client back to a server to do server
    processing. I would like the HTML and form data both. Is there a simple way
    to capture that? I do not want to submit the page...I will use ajax to send
    the data.
    >
    I know how to get the elements but not the entire page or form. I am really
    just interested in specifying document.form2 and sending that.
    I do not understand why you need the html ...
    Simplest being to submit the form2 using Ajax, then on response, to
    populate the fields (or to replace the whole content of form2).

    --
    sm

    Comment

    • MC

      #3
      Re: How do I get HTML sent to server?


      "SAM" <stephanemoriau x.NoAdmin@wanad oo.fr.invalidwr ote in message
      news:48552acc$0 $907$ba4acef3@n ews.orange.fr.. .
      MC a écrit :
      >Hey,
      >>
      >I have a need to get HTML from a client back to a server to do server
      >processing. I would like the HTML and form data both. Is there a simple
      >way to capture that? I do not want to submit the page...I will use ajax
      >to send the data.
      >>
      >I know how to get the elements but not the entire page or form. I am
      >really just interested in specifying document.form2 and sending that.
      >
      I do not understand why you need the html ...
      Simplest being to submit the form2 using Ajax, then on response, to
      populate the fields (or to replace the whole content of form2).
      >
      --
      sm
      Because a 3rd party server library requires it for processing just as it
      looks completed on the client browser.


      Comment

      • Jonas Raoni

        #4
        Re: How do I get HTML sent to server?

        On Sun, 15 Jun 2008 17:57:11 -0300, MC <"mica[removethis]"@aisus.com >
        wrote:
        Because a 3rd party server library requires it for processing just as it
        looks completed on the client browser.
        Strange. If you want the *exactly* HTML sent back to your server, you
        should not use "innerHTML" (the browser may output it the way it wants),
        instead store (at server-side time) a copy of the HTML that must be sent
        back somewhere (hidden input, JavaScript variable, [...]) and when sending
        your form, grab that content.


        --
        Jonas Raoni Soares Silva

        Comment

        • MC

          #5
          Re: How do I get HTML sent to server?


          "Jonas Raoni" <jonasraoni@gma il.comwrote in message
          news:op.ucte9vd lrwisdc@jonasra oni...
          On Sun, 15 Jun 2008 17:57:11 -0300, MC <"mica[removethis]"@aisus.com >
          wrote:
          >Because a 3rd party server library requires it for processing just as it
          >looks completed on the client browser.
          >
          Strange. If you want the *exactly* HTML sent back to your server, you
          should not use "innerHTML" (the browser may output it the way it wants),
          instead store (at server-side time) a copy of the HTML that must be sent
          back somewhere (hidden input, JavaScript variable, [...]) and when sending
          your form, grab that content.
          >
          >
          --
          Jonas Raoni Soares Silva
          http://jsfromhell.com
          Ok, again, the library wants the entire content to process. It will make an
          archive of the page the way the client sees it with their form data added.
          Does anyone know how to do this?

          MC

          Mica


          Comment

          • Evertjan.

            #6
            Re: How do I get HTML sent to server?

            MC wrote on 16 jun 2008 in comp.lang.javas cript:
            Ok, again, the library wants the entire content to process. It will
            make an archive of the page the way the client sees it with their form
            data added. Does anyone know how to do this?
            Who is the boss, you the programmer or the library?
            If you do not like a library function, write your own alternative one.

            --
            Evertjan.
            The Netherlands.
            (Please change the x'es to dots in my emailaddress)

            Comment

            • SAM

              #7
              Re: How do I get HTML sent to server?

              Evertjan. a écrit :
              MC wrote on 16 jun 2008 in comp.lang.javas cript:
              >
              >Ok, again, the library wants the entire content to process. It will
              >make an archive of the page the way the client sees it with their form
              >data added. Does anyone know how to do this?
              >
              Who is the boss, you the programmer or the library?
              If you do not like a library function, write your own alternative one.
              True but :
              that doesn't explain to me how it is possible to submit the html ... ?!
              (I thought it needs ftp)

              What I do not understand : certainly somebody or something did create
              the html, so it is most than probable that the html file must exist
              somewhere (or can be saved somewhere).

              --
              sm

              Comment

              • Evertjan.

                #8
                Re: How do I get HTML sent to server?

                SAM wrote on 16 jun 2008 in comp.lang.javas cript:
                Evertjan. a écrit :
                >MC wrote on 16 jun 2008 in comp.lang.javas cript:
                >>
                >>Ok, again, the library wants the entire content to process. It will
                >>make an archive of the page the way the client sees it with their
                >>form data added. Does anyone know how to do this?
                >>
                >Who is the boss, you the programmer or the library?
                >If you do not like a library function, write your own alternative
                >one.
                >
                True but :
                that doesn't explain to me how it is possible to submit the html ...
                ?! (I thought it needs ftp)
                You can send any string to the server using form post.
                HTML is just a text string.
                What I do not understand : certainly somebody or something did create
                the html, so it is most than probable that the html file must exist
                somewhere (or can be saved somewhere).
                If you mean the html of a web page, that either exists on the server as
                a file or is made on the spot by serverside script. And the received
                html is probably stored in the client browser cashe, but that file is
                not available to clientside script, only through the browser's
                view-source menu, or you can search for it by hand on your computer.

                So why not "get" it from the server using xmlhttp. You can even, with
                serverside scripting, have called by the server any page on the web, so
                also pages on the own server, without involving the client, other than
                that the clinet initiates that script.

                If, however, you mean "the html" on the client browser [posweebly after
                the client has manipulated it by inserting strings, or by clientside
                script], that does not exist, as the visualisation is stored in the DOM
                tree, a kind of relational database, and if you call innerHTML of the
                body, a new and certainly different html is [re]constructed from the DOM
                tree, and most of the <headpart is usually not reconstructed.

                ===========

                Anyway, I repeat myself, your "need" is only due to a illogical slavery
                on your part to your library.

                --
                Evertjan.
                The Netherlands.
                (Please change the x'es to dots in my emailaddress)

                Comment

                • SAM

                  #9
                  Re: How do I get HTML sent to server?

                  Evertjan. a écrit :
                  SAM wrote on 16 jun 2008 in comp.lang.javas cript:
                  >
                  Anyway, I repeat myself, your "need" is only due to a illogical slavery
                  on your part to your library.
                  Thanks for the given light, but I'm not the OP :-)

                  --
                  sm

                  Comment

                  • Evertjan.

                    #10
                    Re: How do I get HTML sent to server?

                    SAM wrote on 16 jun 2008 in comp.lang.javas cript:
                    Evertjan. a écrit :
                    >SAM wrote on 16 jun 2008 in comp.lang.javas cript:
                    >>
                    >Anyway, I repeat myself, your "need" is only due to a illogical slavery
                    >on your part to your library.
                    >
                    Thanks for the given light, but I'm not the OP :-)
                    Oh, sorry.


                    --
                    Evertjan.
                    The Netherlands.
                    (Please change the x'es to dots in my emailaddress)

                    Comment

                    • MC

                      #11
                      Re: How do I get HTML sent to server?

                      Anyway, I repeat myself, your "need" is only due to a illogical slavery
                      on your part to your library.
                      >
                      --
                      Evertjan.
                      The Netherlands.
                      (Please change the x'es to dots in my emailaddress)
                      Evertjan,

                      This is not an illogical slavery. The library is GREAT. Everybody is hung up
                      on why I want to do this and not the how.
                      DOES ANYONE KNOW HOW???

                      The why, is I want to construct an archival image of the view a user sees in
                      a client browser. This library can be used to construct an encrypted page
                      view image while maintaining inner data and it is easily renderable while
                      encrypted by most browsers. The archival image will be used as a legal
                      construct to document what a user saw in the browser and may be used in
                      court. Web sites do not come from a single server so reconstructing what the
                      server serves is inappropriate as the client view may get content from
                      dozens of servers to build a single client view.

                      MC


                      Comment

                      • Lasse Reichstein Nielsen

                        #12
                        Re: How do I get HTML sent to server?

                        "MC" <mica[removethis]@aisus.comwrite s:
                        Because a 3rd party server library requires it for processing just as it
                        looks completed on the client browser.
                        Sending the HTML won't give you that. It only gives you the structure
                        of the HTML, not what it *looks* like when displayed in a browser.
                        For that, you need a screenshot.

                        If you insist on converting the page's document structure back to HTML
                        and send that back to the server (including user-entered values in
                        form controls), you'll have to traverse the DOM structure and build
                        the HTML.

                        The non-standard innerHTML property only reads the original value
                        of input controls (i.e., "inputControl.o riginalValue", not the currently
                        entered value, "inputControl.v alue"). I.e., it misses the user entered
                        values.

                        This means that the HTML you generate is not what is currently being
                        shown, but *your* conversion of the DOM objects into a text
                        representation. If you are doing that anyway, why not just send
                        the values and build the structure on the server side.

                        Or, if you really, really need to be sure what the user sees,
                        accept his values as a normal form submit, and then generate
                        a bitmap image displaying those values along with a secret word,
                        and have the user submit the secret word to confirm that he
                        agrees with the data in the image.
                        That way you know what image was displayed, and that he can see
                        images.

                        /L
                        --
                        Lasse Reichstein Nielsen - lrn@hotpop.com
                        DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
                        'Faith without judgement merely degrades the spirit divine.'

                        Comment

                        • Evertjan.

                          #13
                          Re: How do I get HTML sent to server?

                          MC wrote on 16 jun 2008 in comp.lang.javas cript:
                          >
                          >Anyway, I repeat myself, your "need" is only due to a illogical
                          >slavery on your part to your library.
                          [please do not quote signatures on usenet]
                          This is not an illogical slavery. The library is GREAT.
                          Wow, GREAT if you say so! I do not believe so.
                          That just means you are a willing slave to that greatness.
                          Everybody is
                          I wouldn't think everybody, as you did not ask or hear evrybody.
                          Are you a man or woman of superlatives?
                          hung up on why I want to do this and not the how.
                          DOES ANYONE KNOW HOW???
                          You cannot do this and you should not want to do this.
                          Wanting to do what is impossible is nice, but not productive.
                          The why, is I want to construct an archival image of the view a user
                          sees in a client browser.
                          1 html does only approximately show how different browsers, different sizes
                          and different OS'es show a window.

                          2 html is available on the server and can be directly taken from the server
                          by xmlhttp.

                          3 html does not show the changes made to the DOM on the browser.

                          [I wrote all these arguments before in this thread]
                          This library can be used to construct an
                          encrypted page view image while maintaining inner data and it is
                          easily renderable while encrypted by most browsers.
                          Impossible, if you mean "image" like most of us do.

                          What is "inner data", html being html?

                          What is "renderable " in the sense of a browser, a browser does not render
                          html, as html is the source as far as the browser is concerned?

                          What browser "encripts" the html?
                          Or do you mean parsing the html source to the DOM?
                          The archival image
                          will be used as a legal construct to document what a user saw in the
                          browser and may be used in court.
                          You must have a very naive judge to believe such.
                          Web sites do not come from a single
                          server so reconstructing what the server serves is inappropriate as
                          the client view may get content from dozens of servers to build a
                          single client view.
                          Could be true, but that is immaterial, only using clientside in-browser
                          javascript scripting.

                          You would need to conserve a screenview or a windowview, quite possible
                          with a seperate programme, but not just with browser scripting.

                          And even so, such view can be easily manipulated, so would not do for
                          juridical proof.

                          =============== =============== ==========

                          Remember you asked:
                          "How do I get HTML sent to server?"
                          [Which server, btw, since now you stipulate several servers?]

                          And not:
                          "How do I send a screenview to the server ?"

                          And I showed "sending html to a server" to be inappropriate for conserving
                          the view the user has seen on his or her screem.

                          --
                          Evertjan.
                          The Netherlands.
                          (Please change the x'es to dots in my emailaddress)

                          Comment

                          • MC

                            #14
                            Re: How do I get HTML sent to server?


                            "Evertjan." <exjxw.hannivoo rt@interxnl.net wrote in message
                            news:Xns9ABFB31 08BFDeejj99@194 .109.133.242...
                            MC wrote on 16 jun 2008 in comp.lang.javas cript:
                            >
                            >>
                            >>Anyway, I repeat myself, your "need" is only due to a illogical
                            >>slavery on your part to your library.
                            >
                            [please do not quote signatures on usenet]
                            >
                            >This is not an illogical slavery. The library is GREAT.
                            >
                            Wow, GREAT if you say so! I do not believe so.
                            That just means you are a willing slave to that greatness.
                            >
                            >Everybody is
                            >
                            I wouldn't think everybody, as you did not ask or hear evrybody.
                            Are you a man or woman of superlatives?
                            >
                            >hung up on why I want to do this and not the how.
                            >DOES ANYONE KNOW HOW???
                            >
                            You cannot do this and you should not want to do this.
                            Wanting to do what is impossible is nice, but not productive.
                            >
                            >The why, is I want to construct an archival image of the view a user
                            >sees in a client browser.
                            >
                            1 html does only approximately show how different browsers, different
                            sizes
                            and different OS'es show a window.
                            >
                            2 html is available on the server and can be directly taken from the
                            server
                            by xmlhttp.
                            >
                            3 html does not show the changes made to the DOM on the browser.
                            >
                            [I wrote all these arguments before in this thread]
                            >
                            >This library can be used to construct an
                            >encrypted page view image while maintaining inner data and it is
                            >easily renderable while encrypted by most browsers.
                            >
                            Impossible, if you mean "image" like most of us do.
                            >
                            What is "inner data", html being html?
                            >
                            What is "renderable " in the sense of a browser, a browser does not render
                            html, as html is the source as far as the browser is concerned?
                            >
                            What browser "encripts" the html?
                            Or do you mean parsing the html source to the DOM?
                            >
                            >The archival image
                            >will be used as a legal construct to document what a user saw in the
                            >browser and may be used in court.
                            >
                            You must have a very naive judge to believe such.
                            >
                            > Web sites do not come from a single
                            >server so reconstructing what the server serves is inappropriate as
                            >the client view may get content from dozens of servers to build a
                            >single client view.
                            >
                            Could be true, but that is immaterial, only using clientside in-browser
                            javascript scripting.
                            >
                            You would need to conserve a screenview or a windowview, quite possible
                            with a seperate programme, but not just with browser scripting.
                            >
                            And even so, such view can be easily manipulated, so would not do for
                            juridical proof.
                            >
                            =============== =============== ==========
                            >
                            Remember you asked:
                            "How do I get HTML sent to server?"
                            [Which server, btw, since now you stipulate several servers?]
                            >
                            And not:
                            "How do I send a screenview to the server ?"
                            >
                            And I showed "sending html to a server" to be inappropriate for conserving
                            the view the user has seen on his or her screem.
                            >
                            --
                            Evertjan.
                            The Netherlands.
                            (Please change the x'es to dots in my emailaddress)
                            Look,
                            This is not helping and its not constructive. Yes, the main html is served
                            by a single page but the inner content may come from dozens of servers. We
                            are trying our best to approximate and document the client view. And yes, I
                            can construct an encrypted image that is comprised of data elements using
                            this library. I don't care if you have a problem with that. The how is what
                            I am interested in. It seems that if you can't offer a solution, then the
                            problem is criticized. I thought pointy ears was the only one being
                            unfriendly in that manner here.
                            MC


                            Comment

                            • MC

                              #15
                              Re: How do I get HTML sent to server?


                              "Lasse Reichstein Nielsen" <lrn@hotpop.com wrote in message
                              news:prqhbdss.f sf@hotpop.com.. .
                              "MC" <mica[removethis]@aisus.comwrite s:
                              >
                              >Because a 3rd party server library requires it for processing just as it
                              >looks completed on the client browser.
                              >
                              Sending the HTML won't give you that. It only gives you the structure
                              of the HTML, not what it *looks* like when displayed in a browser.
                              For that, you need a screenshot.
                              >
                              If you insist on converting the page's document structure back to HTML
                              and send that back to the server (including user-entered values in
                              form controls), you'll have to traverse the DOM structure and build
                              the HTML.
                              >
                              The non-standard innerHTML property only reads the original value
                              of input controls (i.e., "inputControl.o riginalValue", not the currently
                              entered value, "inputControl.v alue"). I.e., it misses the user entered
                              values.
                              >
                              This means that the HTML you generate is not what is currently being
                              shown, but *your* conversion of the DOM objects into a text
                              representation. If you are doing that anyway, why not just send
                              the values and build the structure on the server side.
                              >
                              Or, if you really, really need to be sure what the user sees,
                              accept his values as a normal form submit, and then generate
                              a bitmap image displaying those values along with a secret word,
                              and have the user submit the secret word to confirm that he
                              agrees with the data in the image.
                              That way you know what image was displayed, and that he can see
                              images.
                              >
                              /L
                              --
                              Lasse Reichstein Nielsen - lrn@hotpop.com
                              DHTML Death Colors:
                              <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
                              'Faith without judgement merely degrades the spirit divine.'
                              THANK YOU!
                              I appreciate someone trying to help rather than criticize!

                              Just sending the data back will not work, as the client view may have html
                              content from other sources in its view.

                              I understand that a screenshot would work...any ideas on sending one back to
                              the server based on a .js event? I would really prefer to have a data image
                              as I can encrypt that and still retrieve the data from it. This will allow
                              me to pull data from it and index it to a database while storing the image.
                              The image does not need to be perfect as a client view but as good as
                              possible.

                              Is there any way to traverse and build the HTML and get the user entered
                              data? This is the real question no one seems to be able to answer.

                              MC


                              Comment

                              Working...