Home >Backend Development >PHP Tutorial > javascript同时在指定框架打开两个链接,该怎么解决

javascript同时在指定框架打开两个链接,该怎么解决

WBOY
WBOYOriginal
2016-06-13 13:35:23850browse

javascript同时在指定框架打开两个链接
我想用javascript在指定的ifame里面打开两个网页,同时刷新。谢谢大家了。

------解决方案--------------------

HTML code
  <script>
      var f1_src = "http://www.weibo.com";
      var f2_src = "http://www.douban.com";
      function openAtIframe()
      {
          window.open(f1_src, 'f1');
          window.open(f2_src, 'f2');
      }
  </script>

<div class="a" onclick="openAtIframe(f1_src, f2_src);"><a href="javascript:void(0);">open 2 window</a></div>
<iframe name="f1" width="500" height="700"></iframe>
<iframe name="f2" width="500" height="700"></iframe> <div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn