• javascript的console.log用法


    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;
  • 相关阅读:
    创建HttpFilter与理解多个Filter代码的执行顺序
    Filter
    JSTL
    EL
    JavaBean
    HttpSession之表单的重复提交 & 验证码
    相对路径和绝对路径
    HttpSession之简易购物车
    HttpSession
    Cookie
  • 原文地址:https://www.cnblogs.com/wesky/p/6238049.html
Copyright © 2020-2023  润新知