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

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -