views:

53

answers:

1

I have a table with lots of generic link from a DB.

Now the customer wants to restrict certain types to be linked (or showed). Changing the page that makes the links is very hard, so I want to show some alert to user but would be ideal that the browser stays in the page, instead of navigation to an empty one and force the user o press back.

Is there a HTTP status code that tells the browser to stay in the current page?

+6  A: 

You could try with 204 No Content

See the HTTP RFC

If the client is a user agent, it SHOULD NOT change its document view from that which caused the request to be sent. This response is primarily intended to allow input for actions to take place without causing a change to the user agent's active document view, although any new or updated metainformation SHOULD be applied to the document currently in the user agent's active view.

Ikke
It works! Thanks! Now I have to find a way to notify the user because it swallows the javascript alert also.
Eduardo Molteni