小编Aud*_*dun的帖子

如何使用jquery动态更改iframe中的内容?

我想知道是否有可能有一个带有iframe的站点和一些每30秒更改iframe内容的jquery代码.内容位于不同的网页中.

像这样的东西:

<html>
  <head>
    <script type="text/javascript" src="jquery.js"></script>
    <script>
      $(document).ready(function(){
        var array = new array();
        array[0] = 'http://webPage1.com';
        array[1] = 'http://webPage2.com';
        // And so on.
        // Do something here to change the iframe every 30 second
      });
    </script>
  </head>
  <body>
    <iframe id="frame"></iframe>
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

iframe jquery

88
推荐指数
2
解决办法
20万
查看次数

标签 统计

iframe ×1

jquery ×1