我试图用Jquery将外部网页加载到div(#siteloader)中,但我很难找出如何调整div的高度,以便重新调整大小适合外部网站的内容而不需要滚动条。我绝对不想使用iframe。在div中加载外部网页并调整高度
下面是代码:
<!doctype html>
<html>
<meta charset="utf-8">
<title>Load remote content into object element</title>
<style type="text/css">
object {
width: 100%;
}
</style>
</head>
<body>
<div id="siteloader"></div>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
$("#siteloader")
.html('<object data="https://system.netsuite.com/pages/customerlogin.jsp?country=US">');
</script>
</body>
</html>
任何帮助将不胜感激!
我对iframe做了同样的事情。因为我已经控制了外部HTML我添加到页面函数set_iframe_height(W)P $('#iframe-element')。height(w); }并在嵌入式页面中添加了parent.set_iframe_height($('body')。height()); – galchen