wesky

f1.html代码

<iframe id="frame2" name="frame1" src="ww.html"></iframe>
<script type="text/javascript">
    function ss(){
        console.log($(\'#frame1\'))   // 打印信息
        $f = $(\'#frame2\')[0].contentDocument.documentElement.innerText;  // 获取子窗口内容信息
        alert($f);
    }
    setTimeout(ss,3000);
</script>

ww.html代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
1111
</body>
</html>

 

使用  console.log($(\'#frame1\'))  查看参数

获取值的方法

$f = console.log($(\'#frame1\')[0].contentDocument.documentElement.innerHTML);

$f = console.log($(\'#frame1\')[0].contentDocument.documentElement.innerText);

$f = $(\'#frame2\')[0].contentDocument.documentElement.innerText;

 

分类:

技术点:

相关文章:

  • 2022-01-19
  • 2021-09-08
  • 2021-09-30
  • 2021-09-08
  • 2022-12-23
  • 2021-09-08
  • 2021-09-08
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2022-01-01
  • 2021-09-08
  • 2021-09-08
相关资源
相似解决方案