<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>iframe fit to actual height</title>
<script>
function resizeIFrameToFitContent()
{
iFrame1.width = "800px"; // iFrame.contentWindow.document.body.scrollWidth;
iFrame1.height = iFrame.contentWindow.document.body.scrollHeight+20;
}
</script>
</head>
<body>
<iframe name="iFrame1" src="" style="border:none" onload="resizeIFrameToFitContent()"></iframe>
</body>
</html>