Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Submit without refreshing page?

Reply
Thread Tools

Submit without refreshing page?

 
 
Martin
Guest
Posts: n/a
 
      05-05-2005
I have a situation where I want to allow the user to click a button on
a page (in a table cell, if it makes any difference) that will
activate a server-side script. There is no need to have the user's
page refresh or update.

I'm currently using the following in the table cell but after calling
my script on the server, the page is resent. I'd like to avoid that.

<FORM method='post'><INPUT type='submit' value='Release Lane'
name='RELEASE' </FORM>


Thanks for any suggestions.
 
Reply With Quote
 
 
 
 
data64
Guest
Posts: n/a
 
      05-05-2005
Martin <(E-Mail Removed)> wrote in
news(E-Mail Removed):

> I have a situation where I want to allow the user to click a button on
> a page (in a table cell, if it makes any difference) that will
> activate a server-side script. There is no need to have the user's
> page refresh or update.
>


Maybe use an IFrame ? Google maps does something like this using javascript.

data64
 
Reply With Quote
 
 
 
 
Si Ballenger
Guest
Posts: n/a
 
      05-06-2005
On Thu, 05 May 2005 13:47:51 -0700, Martin
<(E-Mail Removed)> wrote:

>I have a situation where I want to allow the user to click a button on
>a page (in a table cell, if it makes any difference) that will
>activate a server-side script. There is no need to have the user's
>page refresh or update.
>
>I'm currently using the following in the table cell but after calling
>my script on the server, the page is resent. I'd like to avoid that.
>
><FORM method='post'><INPUT type='submit' value='Release Lane'
>name='RELEASE' </FORM>
>
>
>Thanks for any suggestions.


Have your script output the status: 204 code followed by two
blank lines. This will tell the brouser to not refresh the page.
I use it on my webcam pan tilt page below.

http://www.geocities.com/zoomkat/ezservo1.htm

 
Reply With Quote
 
Disco Octopus
Guest
Posts: n/a
 
      05-06-2005
Martin wrote :
> I have a situation where I want to allow the user to click a button on
> a page (in a table cell, if it makes any difference) that will
> activate a server-side script. There is no need to have the user's
> page refresh or update.
>
> I'm currently using the following in the table cell but after calling
> my script on the server, the page is resent. I'd like to avoid that.
>
> <FORM method='post'><INPUT type='submit' value='Release Lane'
> name='RELEASE' </FORM>
>
>
> Thanks for any suggestions.


we used to do something like this but we send over data. using
javascript...

* onClick of a button (Not a submit button).
1. create a new window/popup
2. send the new window the input data from the <from> on your page.

* onLoad of your new window.
1. submit the <form> that was sent over by the other page.
2. close the window.

--
a beef jerky web site : http://www.choicebeefjerky.com.au
not a beef jerky web site : http://mycoolwheels.com/vote.cmks
if the oil light is on, dont think it will just go away

 
Reply With Quote
 
Martin
Guest
Posts: n/a
 
      05-06-2005
On Fri, 06 May 2005 00:02:13 GMT, shb*NO*SPAM*@comporium.net (Si
Ballenger) wrote:

>On Thu, 05 May 2005 13:47:51 -0700, Martin
><(E-Mail Removed)> wrote:
>
>>I have a situation where I want to allow the user to click a button on
>>a page (in a table cell, if it makes any difference) that will
>>activate a server-side script. There is no need to have the user's
>>page refresh or update.
>>
>>I'm currently using the following in the table cell but after calling
>>my script on the server, the page is resent. I'd like to avoid that.
>>
>><FORM method='post'><INPUT type='submit' value='Release Lane'
>>name='RELEASE' </FORM>
>>
>>
>>Thanks for any suggestions.

>
>Have your script output the status: 204 code followed by two
>blank lines. This will tell the brouser to not refresh the page.
>I use it on my webcam pan tilt page below.
>
>http://www.geocities.com/zoomkat/ezservo1.htm



Thanks - that worked perfectly (how did you ever figure that out?).
 
Reply With Quote
 
Si Ballenger
Guest
Posts: n/a
 
      05-06-2005
On Fri, 06 May 2005 07:34:53 -0700, Martin
<(E-Mail Removed)> wrote:

>On Fri, 06 May 2005 00:02:13 GMT, shb*NO*SPAM*@comporium.net (Si
>Ballenger) wrote:
>
>>On Thu, 05 May 2005 13:47:51 -0700, Martin
>><(E-Mail Removed)> wrote:
>>
>>>I have a situation where I want to allow the user to click a button on
>>>a page (in a table cell, if it makes any difference) that will
>>>activate a server-side script. There is no need to have the user's
>>>page refresh or update.
>>>
>>>I'm currently using the following in the table cell but after calling
>>>my script on the server, the page is resent. I'd like to avoid that.
>>>
>>><FORM method='post'><INPUT type='submit' value='Release Lane'
>>>name='RELEASE' </FORM>
>>>
>>>
>>>Thanks for any suggestions.

>>
>>Have your script output the status: 204 code followed by two
>>blank lines. This will tell the brouser to not refresh the page.
>>I use it on my webcam pan tilt page below.
>>
>>http://www.geocities.com/zoomkat/ezservo1.htm

>
>
>Thanks - that worked perfectly (how did you ever figure that out?).


It is just a little known part of the HTTP specs that I find very
useful for controlling things via the web. Most html types freak
out on this saying "but they will just keep clicking the button!"
With video feedback or a knowledge of what is going on, that
isn't an issue. Iframes will work too, but they screw up the
brouser "back" button. Below is a page I've come up with that
uses the status: 204 and an iframe to prevent the java script
image pull setup from being disturbed when the cam switch buttons
are pressed.

http://www.geocities.com/zoomkat/wc20000sw.htm

 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      05-08-2005
On Fri, 06 May 2005 07:34:53 -0700, Martin <(E-Mail Removed)>
wrote:


>>Have your script output the status: 204 code followed by two
>>blank lines. This will tell the brouser to not refresh the page.


>Thanks - that worked perfectly (how did you ever figure that out?).


It's in the HTTP spec - originally intended as a "no-op" code for use
with null clicks for server-side imagemaps.


On a related topic, here's a drawback with the Google Web Accelerator
http://37signals.com/svn/archives2/g..._designers.php

If you'd ever wondered about the necessity for that "idempotent"
business and the need to be careful with GET vs. POST, here's a hint as
to what happens when you build your site in a non-robust manner and a
great clodhopping thing like this "accelerator" comes along..
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to submit a from using JavaScript [without using submit button]? jatrojoomla Javascript 1 08-24-2006 04:46 AM
Self-refreshing and non-self-refreshing controls Harlan Messinger ASP .Net 1 08-04-2006 01:13 PM
Self-refreshing and non-self-refreshing controls Harlan Messinger ASP .Net Web Controls 0 08-03-2006 12:29 PM
submit the form data to the popup window without a submit button jrefactors@hotmail.com Javascript 2 01-01-2005 06:07 AM
submit the form data to the popup window without a submit button jrefactors@hotmail.com HTML 2 01-01-2005 06:07 AM



Advertisments