我有一个框架内的aspx页面。我想重定向到一个新的页面,但在页面加载之前,打破框架。我使用这个js代码加载之前打破框架页面
window.onload = TimeOutRedirect;
function TimeOutRedirect()
{
try
{
if (self.parent.frames.length != 0)
self.parent.location=document.location;
}
catch (Exception) {}
}
这工作,但一直等到页面加载,所以你可以看到页面在框架中它打破之前。
我尝试使用另一页作为中间人,但我无法在页面加载后重定向。