Don't send a location header if we currently handle an ajax response/request - use the corresponding json function instead. Doing this on the server side is neccessary as the location header is one of the few ones which is handled by the browser before any XMLHttpRequest event is fired (according to W3C specification)

This commit is contained in:
Andreas Stöckel
2011-06-11 21:27:15 +00:00
parent 220af27f60
commit 49ece38c6c
3 changed files with 43 additions and 3 deletions

View File

@ -226,12 +226,21 @@ function egw_json_request(_menuaction, _parameters, _context)
this.onLoadFinish = null;
this.loadedJSFiles = {};
this.handleResponseDone = false;
this.app = null;
if (window.egw_alertHandler)
{
this.alertHandler = window.egw_alertHandler;
}
}
/**
* Sets the "application" object which is passed to egw_appWindowOpen when a redirect is done
*/
egw_json_request.prototype.setAppObject = function(_app)
{
this.app = _app;
}
egw_json_request.prototype._assembleAjaxUrl = function(_menuaction)
{
// Retrieve the webserver url
@ -423,7 +432,7 @@ egw_json_request.prototype.handleResponse = function(data, textStatus, XMLHttpRe
}
else
{
window.location.href = res.data.url;
egw_appWindowOpen(this.app, res.data.url);
}
hasResponse = true;