应对这样浏览器就不会做任何事情 - 这可能吗?

应对这样浏览器就不会做任何事情 - 这可能吗?

问题描述:

是否有可能作出这样的HTTP响应,浏览器会忽略它,并不断显示previously显示的页面?

Is it possible to make such a HTTP response, that the browser ignores it and keeps showing the previously displayed page?

我指的是以下情况:

一)用户点击的东西。

二)一些后进入服务器(或GET,但让我们坚持使用POST作为更有趣)

b) some POST goes to the server (or GET, but let's stick with POST as more interesting)

三)服务器确定为某种原因,它不希望在此时发送应答

c) server decides that for some reason it does not want to send the reply at this time

D)服务器发送特制响应

d) server sends specifically crafted response

E)的浏览器不显示错误页面,不显示空白页,不重定向任何地方,不会重新加载 - 只是不断显示它是显示,如果用户从未提交表单

e) browser does not show the error page, does not show the empty page, does not redirect anywhere, does not reload - just keeps showing what it was showing as if the user never submitted the form

PS当然,它可以用AJAX包裹,但我想请问准系统非JavaScript的解决方案是否可行。

PS Of course it can be wrapped with AJAX, but I ask whether bare-bones non-javascript solution is possible

尝试返回HTTP 204无内容。请参阅 RFC 2616(超文本传输​​协议这种反应code的描述 - HTTP /1.1),它说:

Try returning HTTP 204 No Content. See the description of this response code in RFC 2616 (Hypertext Transfer Protocol -- HTTP/1.1 ) where it says:

如果客户是用户代理,它不应该改变,从它的文档视图
  这造成要发送的请求。这种反应主要是为了让
  采取行动的输入发生,而不会引起更改用户代理的积极
  文档视图,但任何新的或更新的元信息应该应用到
  在用户代理的积极看法目前记录。

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.