[thelist] Posting Data with JavaScript

Mark Howells mark at mountain.ch
Fri Dec 14 04:52:35 CST 2001


If you're using a standard HTML form, then you can use method="get". That
places all values in the form into the URL line, using the standard query
parameter method.

For example, if I had a form on my page with two fields, called li and lang,
and the action="http://www.mark.ac/photo/index.php", then using the GET
method would send me to this URL

http://www.mark.ac/photo/index.php?li=coll&lang=e

You'll need some kind of server processing to do anything with the data at
server level, but the browser Javascript on the "receiving page" can get the
query parameters using location.search.

For example

alert(location.search) would produce "?li=coll&lang=e" (which you can then
cut up using the substring() method).

<wrapping link>
http://directory.google.com/Top/Computers/Programming/Languages/JavaScript/A
rticles/
</wrap>

Regards
Mark Howells
Working in a Winter Wonderland
http://www.mark.ac


> Von: "Syed Zeeshan Haider" <zeeshan_paki at yahoo.com>
> Antworten an: thelist at lists.evolt.org
> Datum: Fri, 14 Dec 2001 15:41:30 +0500
> An: "Evolt" <thelist at lists.evolt.org>
> Betreff: [thelist] Posting Data with JavaScript
> 
> Is there any way to post data from
> 1.    one web page to another web page
> 2.    one web page to the server
> with the help of JavaScript (without using CGI)?





More information about the thelist mailing list