i have page using iframe:
page a.html:
<div id="results">
  <iframe src="../b.aspx"></iframe>
</div>
now i want to get elements in iframe, so i try:
<script type="text/javascript">
        jQuery(document).ready(function($) {
            var tmp = $('#results iframe').contents().find('html').html();
            alert(tmp);
        });
</script>
but result return is: <head></head><body></body>, don't have content in head or body. i need a help
Because your frame is not again loaded..
Try
$("#YOURFRAME").load(function (){
  var tmp = $('#results iframe').contents().find('html').html();
  alert(tmp);
});
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With