HX-Push-Url 响应标头

HX-Push-Url 标头允许你将 URL 推送到浏览器 位置历史记录。这将创建一个新的历史记录条目,允许使用浏览器的后退和前进按钮进行导航。这类似于 hx-push-url 属性

¥The HX-Push-Url header allows you to push a URL into the browser location history. This creates a new history entry, allowing navigation with the browser’s back and forward buttons. This is similar to the hx-push-url attribute.

如果存在,此标头将覆盖使用属性定义的任何行为。

¥If present, this header overrides any behavior defined with attributes.

此标头的可能值为:

¥The possible values for this header are:

  1. 要推送到位置栏的 URL。根据 history.pushState(),这可能是相对的或绝对的。

    ¥A URL to be pushed into the location bar. This may be relative or absolute, as per history.pushState().

  2. false,阻止浏览器的历史记录更新。

    ¥false, which prevents the browser’s history from being updated.

注释

¥Notes

3xx 响应代码不会处理响应标头。参见 响应标头

¥Response headers are not processed on 3xx response codes. see Response Headers