[Webkit-unassigned] [Bug 215131] New: Issue getting iframe height through jQuery

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 4 10:36:44 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=215131

            Bug ID: 215131
           Summary: Issue getting iframe height through jQuery
           Product: WebKit
           Version: Safari 13
          Hardware: Macintosh
                OS: macOS 10.15
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Frames
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: dc97080 at gmail.com

Hi,

I am having an issue with getting the height of an iframe's body element through jQuery. It works in Chromium based browsers as intended, but it returns 0 as the height (in bdyheight). I was asked by a Safari developer to post this here. If there is a workaround that is known, please let me know!

Here's the code:

<iframe id="dbframe" src="https://transitiontn.org/assessment-database-vr/" width="100%" scrolling="no" >

<script>
  jQuery("#dbframe").on("load", function() {
  let head = jQuery(this).contents().find("head");
  let css = '<style>#top-header, #main-header, #main-footer{display: none;}#page-container{padding-top: 0!important;}               </style>';
  jQuery(head).append(css);
  let bdyheight = jQuery(this).contents().find("body").height();
  jQuery(this).height(bdyheight);

  let dblinks = jQuery(this).contents().find("td a");
  jQuery(dblinks).click(function() {
    jQuery("html").animate({scrollTop: 0 }, 800);
    window.setTimeout(function(){jQuery("#dbframe").height(2000)}, 2000);   
  });  
  }); 
</script>

Thank you!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200804/9b2289fe/attachment.htm>


More information about the webkit-unassigned mailing list