HighDots Forums  

How do I get HTML sent to server?

Javascript JavaScript language (comp.lang.javascript)


Discuss How do I get HTML sent to server? in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
MC
 
Posts: n/a

Default How do I get HTML sent to server? - 06-15-2008 , 09:20 AM






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



Reply With Quote
  #2  
Old   
SAM
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-15-2008 , 10:44 AM






MC a écrit :
Quote:
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


Reply With Quote
  #3  
Old   
MC
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-15-2008 , 04:57 PM




"SAM" <stephanemoriaux.NoAdmin (AT) wanadoo (DOT) fr.invalid> wrote

Quote:
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.




Reply With Quote
  #4  
Old   
Jonas Raoni
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-15-2008 , 08:21 PM



On Sun, 15 Jun 2008 17:57:11 -0300, MC <"mica[removethis]"@aisus.com>
wrote:
Quote:
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


Reply With Quote
  #5  
Old   
MC
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-15-2008 , 10:33 PM




"Jonas Raoni" <jonasraoni (AT) gmail (DOT) com> wrote

Quote:
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




Reply With Quote
  #6  
Old   
Evertjan.
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-16-2008 , 05:37 AM



MC wrote on 16 jun 2008 in comp.lang.javascript:

Quote:
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)


Reply With Quote
  #7  
Old   
SAM
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-16-2008 , 06:17 AM



Evertjan. a écrit :
Quote:
MC wrote on 16 jun 2008 in comp.lang.javascript:

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


Reply With Quote
  #8  
Old   
Evertjan.
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-16-2008 , 07:02 AM



SAM wrote on 16 jun 2008 in comp.lang.javascript:

Quote:
Evertjan. a écrit :
MC wrote on 16 jun 2008 in comp.lang.javascript:

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.

Quote:
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 <head> part 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)


Reply With Quote
  #9  
Old   
SAM
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-16-2008 , 07:49 AM



Evertjan. a écrit :
Quote:
SAM wrote on 16 jun 2008 in comp.lang.javascript:

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



Reply With Quote
  #10  
Old   
Evertjan.
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-16-2008 , 07:53 AM



SAM wrote on 16 jun 2008 in comp.lang.javascript:

Quote:
Evertjan. a écrit :
SAM wrote on 16 jun 2008 in comp.lang.javascript:

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)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.