Qatrix icon indicating copy to clipboard operation
Qatrix copied to clipboard

$ready中浏览器差异

Open sxd1140 opened this issue 12 years ago • 2 comments

a.html $ready(function (){ var container = $("Main"); }

b.html

<iframe src = "a.html">

在ie浏览器下 container 为NULL

非ie浏览器下 正常

sxd1140 avatar Nov 29 '12 06:11 sxd1140

Could you like to post all source code of a.html and b.html?

If you want to call ready function after iframe is loaded on IE, just load Qatrix framework and call ready function under iframe.

qatrix avatar Dec 02 '12 12:12 qatrix

a.html

<html>
    <head>
        <title>testa</title>
        <script type="text/javascript" src="qatrix-1.0.1.min.js"></script>
        <script type="text/javascript">
            $ready(function (){
                alert($("Main"));
            });
        </script>
    </head>
    <body>
        <div id = "Main"></div>
    </body>
</html>

b.html

<html> 
    <head>
        <title>testb</title>
    </head>
    <body>
        <iframe src = "a.html" marginwidth="0" marginheight="0" width = "100%" height = "100%" ></iframe>
    </body>
</html>

直接开a.html 正确 开b.html 就null了

sxd1140 avatar Dec 03 '12 07:12 sxd1140