javascript - added js code doesn't work in iframe -


i have iframe containing div tag "firstheadsection" id.

after iframe loaded, append code iframe:

    <script>     $(window).on("resize", function(){     alert($("#firstheadsection").height())     })     </script> 

the js code inserted after resize window, alerts null.

jquery included in iframe.

what should do?

you have access main page, have prepend "parent". try this: (not tested)

parent.$.fn.resize(function() {     alert($("#firstheadsection").height()); }); 

Comments

Popular posts from this blog

java - Static nested class instance -

Python Pandas join aggregated tables -

process - Python What is the difference between a Pool of worker processes and just running multiple Processes? -