How does js calculate the correct height of iframe src content? Via instagram

subject
I want to use iframe and introduce it into my web site with instagram. However, the manager was unable to solve the height problem of "calculating" the content

.

Code

<iframe src="https://www.instagram.com/p/BoEDAZMHW2R/embed/" allowtransparency="true" frameborder="0" scrolling="no"></iframe>

the degree can be set, but the height is unpredictable, because the size of the film and movie of the content is completely unknown: https://www.instagram.com/p/B.

.

so I would like to ask whether js has a way to get the content height of SRC and send it back to iframe height ?

what functions or examples can be used?


you can try to get the total width and height of the internal elements of the document after preloading in the onload event of iframe .

then use document.getElementsById ('your iframe'). ContentWindow.document.getElementById (' the elements you need') to get the height of the page elements

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b304c6-2b54e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b304c6-2b54e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?