I work in a project where I have to redirect errors to a page in a specific scenario. To do this, I created the Error.aspx page. Right now I am using window.top.location.href = "../Error.aspx" and it generates http: //localhost/app_web/Error.aspx and its working fine except for one (which shows the message http: // xyz /ErrorPage.aspx 'does not exist.). So can anyone suggest which option is better for this.
thank
top ", " parent, , , , .
top
parent
, :
var local = location.pathname.split("/"); local.pop(); // remove the filename local.pop(); // remove the containing directory local.push("Error.aspx"); local = location.protocol+"//"+location.hostname+"/"+local.join("/"); top.location.href = local;
window.parent . , ..
window.parent
window.top ; window.parent.parent.parent[...];
window.top
window.parent.parent.parent[...]
, , , , , :
window.location.href = "../Error.aspx";
. window.parent, window.top window.location.
window.location
, .
window.parent.location
.
window.top.location