 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Stacey Guest
|
Posted: Sat Jul 12, 2003 1:15 am Post subject: Need help with posting to CGI from javascript |
|
|
Here is a function that is declared in my html page. It is part of a series
of javascript that allows the user to draw a rectangle on a graphic. This
is called when the box is done, so I would like to send the screen coords
which I know already to a cgi script at this point below. Can anybody help
me?
Somebody mentioned this code, but I am not sure how exactly to go about and
where to put code etc etc. It uses the urlconnection. Not sure of syntax.
Thanks again.
http://www.javaworld.com/javaworld/javatips/jw-javatip34.html
function dragDone(x,y) {
startlayer.moveTo(iX,iY)
alert("Box is done")
need to post to cgi here
}
|
|
| Back to top |
|
 |
Miguel De Anda Guest
|
Posted: Sat Jul 12, 2003 1:33 am Post subject: Re: Need help with posting to CGI from javascript |
|
|
"Stacey" <stacye (AT) optonline (DOT) net> wrote
| Quote: | Here is a function that is declared in my html page. It is part of a
series
of javascript that allows the user to draw a rectangle on a graphic. This
is called when the box is done, so I would like to send the screen coords
which I know already to a cgi script at this point below. Can anybody
help
me?
Somebody mentioned this code, but I am not sure how exactly to go about
and
where to put code etc etc. It uses the urlconnection. Not sure of
syntax.
Thanks again.
http://www.javaworld.com/javaworld/javatips/jw-javatip34.html
function dragDone(x,y) {
startlayer.moveTo(iX,iY)
alert("Box is done")
need to post to cgi here
}
|
function dragDone(x,y) {
startlayer.moveTo(iX,iY);
alert("Box is done");
if ("java"=="javscript") {
alert("Ask question in comp.lang.java.help");
} else {
alert("Ask question in comp.lang.javascript");
}
}
But if you really want to know, this is what I like to do:
I create a hidden frame, be it an iframe or from a frameset. Have a form in
there that will receive data from the dragDone(x,y) function. Submit the
form to you cgi. This will prevent the main window from submiting the data
(and prevent the user from doing more things). From what I'm guessing, you
may need some way to buffer the input and send larger packets of input
together.
|
|
| Back to top |
|
 |
Ron Savage Guest
|
Posted: Mon Jul 14, 2003 11:38 am Post subject: Re: Need help with posting to CGI from javascript |
|
|
"Stacey" <stacye (AT) optonline (DOT) net> wrote
| Quote: | Here is a function that is declared in my html page. It is part of a
series
of javascript that allows the user to draw a rectangle on a graphic. This
is called when the box is done, so I would like to send the screen coords
which I know already to a cgi script at this point below. Can anybody
help |
# 30:
http://savage.net.au/Perl-tuts-1-30.html
--
Ron Savage
[email]ron (AT) savage (DOT) net.au[/email]
http://savage.net.au/index.html
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|