当前位置: 首页 > 知识 >正文

js获取iframe中的内容(js 刷新网页)

iframe src='1.htm' name='ifrmname' id='ifrmid'/iframe

方案一:用iframe的name属性定位。

input type='button' name='Button' value='Button'

onclick='document.frames('ifrmname').location.reload()'

input type='button' name='Button' value='Button'

onclick='document.all.ifrmname.document.location.reload()'

方案二:使用iframe的id属性定位。

input type='button' name='Button' value='Button'

onclick='ifrmid.window.location.reload()'

终极解决方案:当iframe的src是其他网站的地址时(跨域操作时)。

input type='button' name='Button' value='Button'

onclick='window.open(document.all.ifrmname.src,'ifrmname','')'

相关文章:
  • 5月19日基金净值:广发国证半导体芯片ETF最新净值1.0878,涨1.7%
  • 4月14日基金净值:国泰中证生物医药ETF最新净值1.2693,跌0.04%
  • 7月10日基金净值:银华可转债债券最新净值1.4589,跌0.45%
  • 5月5日基金净值:长安裕隆混合A最新净值2.5173,跌3.76%
  • 5月17日基金净值:景顺长城核心竞争力混合A最新净值3.03,跌0.56%
  • 整合iis和tomcat 将Tomcat与IIS整合共用80端口
  • 4月19日基金净值:天弘安康颐丰一年持有混合A最新净值0.9857,跌0.26%
  • 5月12日基金净值:交银瑞思混合(LOF)最新净值1.1236,跌1.03%
  • 7月6日基金净值:创金合信数字经济主题股票A最新净值1.4796,跌0.77%
  • 7月3日基金净值:富国红利混合A最新净值0.9695,涨1.14%