How do I make a "link" that doesn't load a new page?

Such links are useful when a form is intended to perform some action on the server machine without sending new information to the client, or when a user has clicked in an undefined area in an image map; these are just two possibilities.

Rob McCool of NCSA provided the following wisdom on the subject:

Yechezkal-Shimon Gutfreund (sg04@gte.com) wrote:
: Ok, here is another bizzare request from me:

: I am currently running scripts which I "DO NOT" want to return
: any visible result. That is, not text/plain, not text/HTML, not
: image/gif. The entire results are the side effects of the
: script and nothing should be returned to the viewer.

: It would be nice to have an internally supported null viewer
: so that I could do this, more "cleanly" (ok, ok, I hear your groans).

HTTP now supports a response code of 204, which is no operation. Some browsers such as Mosaic/X 2.* support it. To use it, make your script a nph script and output an HTTP/1.0 204 header. Something like:

HTTP/1.0 204 No response Server: Myscript/NCSA httpd 1.1

(You can learn more about nph scripts from the NCSA server documentation at the URL http://hoohoo.ncsa.uiuc.edu/docs.) Essentially they are scripts that handle their own HTTP response codes.


World Wide Web FAQ