Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to append element to parent body from an iframe?

I have this code in the iframe.

<script type="text/javascript">
    $(document).ready(function(){
        $("body").append($("#ctap").html());
    });
</script>

I want to append #ctap's html to parent body. How can I do that ?

like image 228
Subin Avatar asked Sep 11 '12 15:09

Subin


1 Answers

Try following piece of code inside document.ready

parent.$("body").append($("#ctap").html());
like image 96
Aravind.HU Avatar answered Nov 06 '22 21:11

Aravind.HU