gpt4 book ai didi

html - 我应该返回什么 HTTP 状态代码告诉浏览器停留在当前页面?

转载 作者:太空狗 更新时间:2023-10-29 15:39:28 24 4
gpt4 key购买 nike

我有一个表,其中包含来自数据库的大量通用链接。

现在客户想要限制某些类型的链接(或显示)。更改创建链接的页面非常困难,所以我想向用户显示一些警告,但理想的情况是浏览器停留在页面中,而不是导航到一个空页面并强制用户按回车键。

是否有 HTTP 状态码告诉浏览器停留在当前页面?

最佳答案

你可以试试 204 No Content

参见 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.

关于html - 我应该返回什么 HTTP 状态代码告诉浏览器停留在当前页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2374802/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com