我有iframe:
<!DOCTYPE html>
<html>
<body>
<div style="height:300px;width:100%;background:red" class="embed-responsive">
<iframe src="test.html" width="auto" height="auto" class="embed-responsive-item" allowfullscreen webkitallowfullscreen mozallowfullscreen frameborder="0"></iframe>
</div>
</html>
我想在test.html中获得iframe的有效高度(不是自动,而是300px)
我试图这样做:
parent.document.getElementsByTagName("iframe")[0].getAttribute("height");
但是结果是自动的而不是300
有人可以帮助我吗?