No redirect when url ends with #

When a redirect url ends with a hash (#) the browser (Chrome) does not redirect/refreshes the browser.

This is happening with this setting:
```
form = SQLFORM.grid(
        query,
        client_side_delete=True
    )
```
This commit is contained in:
jicho
2019-10-09 09:33:18 +02:00
committed by GitHub
parent 1ce316609a
commit e4845aeef6

View File

@@ -283,7 +283,11 @@
doc.ajaxSuccess(function (e, xhr) {
var redirect = xhr.getResponseHeader('web2py-redirect-location');
if (redirect !== null) {
window.location = redirect;
if (!redirect.endsWith('#')) {
window.location.href = redirect;
} else {
window.location.reload();
}
}
/* run this here only if this Ajax request is NOT for a web2py component. */
if (xhr.getResponseHeader('web2py-component-content') === null) {