if (window.location.href == window.top.location.href) 
    {  
         window.top.location.href = "/index.html"; 
    }

top.window.location.reload即刷新父级页面 ,其中top是指父框架的对象

使用情况一般是有嵌套iframe 其iframe的父页面为本如:

<html>
    <iframe src='2.htm'></iframe>
<html>

也就是

  如果iframe中的 2.htm 里面 使用了: top.window.location.reload 那么就是刷新父页面

       如果2.htm里面使用的是: window.location.reload 那就是刷新框架自身页面即iframe中的页面

点赞????+关注我吧~

我只想成为更好的自己

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
  • 2021-11-10
相关资源
相似解决方案