Add a check to handle being called from inside a frame

This commit is contained in:
Nathan Gray 2010-06-09 10:40:17 +00:00
parent 0ae16ca1ed
commit b5179882ab

View File

@ -20,7 +20,15 @@ function egw_json_request(_menuaction, _parameters)
//Copy the supplied parameters
this.menuaction = _menuaction;
this.parameters = _parameters;
this.url = window.egw_webserverUrl + '/json.php';
var url = window.egw_webserverUrl;
// Search up to parent if the current window is in a frame
if(typeof url == "undefined")
{
url = top.egw_webserverUrl;
}
this.url = url + '/json.php';
this.sender = null;
this.callback = null;
this.alertHandler = this.alertFunc;