文章

ifram通过js刷新

<iframe id="myframe" width="100%" frameBorder="0" src="http://127.0.0.1:8088/index1.html"></iframe>
  <iframe id="myframe" width="100%" frameBorder="0" src="http://127.0.0.1:8088/index1.html"></iframe>
  <input type="button" onclick="javascript:refreshFrame();" value="Refresh Frame" />

  <script type="text/javascript">
    function refreshFrame() {
      for (var i = 0; i < myframe.length; i++) {
        var src = myframe[i].src
        myframe[i].src = null;
        myframe[i].src = src;
      }
    }
  </script>
License: