mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 07:21:05 +00:00
Support #anchor redirect refresh (#1172)
This commit is contained in:
parent
3845e0f92e
commit
7296c0d943
11
src/htmx.js
11
src/htmx.js
@ -3307,16 +3307,17 @@ return (function () {
|
||||
return;
|
||||
}
|
||||
|
||||
var shouldRefresh = hasHeader(xhr, /HX-Refresh:/i) && "true" === xhr.getResponseHeader("HX-Refresh");
|
||||
|
||||
if (hasHeader(xhr, /HX-Redirect:/i)) {
|
||||
location.href = xhr.getResponseHeader("HX-Redirect");
|
||||
shouldRefresh && location.reload();
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasHeader(xhr,/HX-Refresh:/i)) {
|
||||
if ("true" === xhr.getResponseHeader("HX-Refresh")) {
|
||||
location.reload();
|
||||
return;
|
||||
}
|
||||
if (shouldRefresh) {
|
||||
location.reload();
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasHeader(xhr,/HX-Retarget:/i)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user