From e4845aeef6b13c8173f155d8692a818c7f0e4ba5 Mon Sep 17 00:00:00 2001 From: jicho Date: Wed, 9 Oct 2019 09:33:18 +0200 Subject: [PATCH] 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 ) ``` --- applications/welcome/static/js/web2py.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/applications/welcome/static/js/web2py.js b/applications/welcome/static/js/web2py.js index 8eaf54aa..e526a306 100644 --- a/applications/welcome/static/js/web2py.js +++ b/applications/welcome/static/js/web2py.js @@ -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) {