history.nette.ajax.js icon indicating copy to clipboard operation
history.nette.ajax.js copied to clipboard

Add way how to force real redirect

Open voslartomas opened this issue 10 years ago • 16 comments

Hi, what is the purpose of assigning redirect value to this.href? I've used old redirect function from nette.ajax and after session is expired, it was redirecting to login page. Now after implementation of history.nette.ajax, there is a problem, because it is not redirecting because of this condition.

if (redirect) {
        var regexp = new RegExp('//' + window.location.host + '($|/)');
        if ((redirect.substring(0,4) === 'http') ? regexp.test(redirect) : true) {
            this.href = redirect;
        } else {
            window.location.href = redirect;
        }
    }

voslartomas avatar Apr 13 '14 12:04 voslartomas