copy the data in iframe to its parent. It works fine in firefox and opera,
bug it can't in ie(both ie6 and ie7).

here is the test case.

the main html file code :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml";>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"
/>

        <script type="text/javascript"
src="../../scripts/jquery/jquery.pack.js"></script>
        <script type="text/javascript">
            var addData = function($data){
                $('#test-data').append($data);
            };
        </script>
    </head>

    <body>
        <div id="test-data"></div>
        <iframe src="datas/full-html-data1.html"></iframe>
    </body>
</html>

and here is the iframe html file code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml";>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"
/>

        <script type="text/javascript"
src="../../../scripts/jquery/jquery.pack.js"></script>
        <script type="text/javascript">
            $(function(){
                $('#test-div').click(function(){
                    window.parent.addData($('p').clone());
                });
            });
        </script>
    </head>

    <body>
        <div id="test-div">click me</div>
        <p>test</p>
    </body>
</html>

when click the "click me", the __<p>test</p>__ should be append in the <div
id="test-data"></div>. It worked in firefox and opera, but can't in ie6 and
ie7.

thanks~

Reply via email to