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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user