<!doctype html>
<html lang="en">
<head>
<title>test page</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body>
<div id="My-page" style="width:900px; height:900px; position: absolute;overflow-x:hidden !important;-webkit-overflow-scrolling:touch !important;" class="iframely-widget-container">
<script>$("#My-page").load("http://www.flipbeets.com/display-embed-code/ZG9sY2VnYWJiYW5h/OTAwcHg=/OTAwcHg=/MQ==/MQ==/MQ==");</script>
</div>
</body>
</html>
我试图通过jquery将flipbeets.com网址加载到div但是它无法正常工作
答案 0 :(得分:1)
试试这个......
<div id="My-page" style="width:900px; height:900px; position: absolute;overflow-x:hidden !important;-webkit-overflow-scrolling:touch !important;" class="iframely-widget-container">
</div>
<script>
$( "#My-page" ).html('<object data=http://www.flipbeets.com/display-embed-code/ZG9sY2VnYWJiYW5h/OTAwcHg=/OTAwcHg=/MQ==/MQ==/MQ=="/>');
</script>
答案 1 :(得分:0)
您可以使用iframe
代替div
来加载外部网站内容。
<iframe id="My-page"></div>
<强>的jQuery 强>
$("#My-page").attr("src","http://www.flipbeets.com/display-embed-code/ZG9sY2VnYWJiYW5h/OTAwcHg=/OTAwcHg=/MQ==/MQ==/MQ==");
<强> Demo 强>
答案 2 :(得分:0)
你可以像这样使用iframe
<html lang="en">
<head>
<title>test page</title>
</head>
<body>
<iframe style="width:900px; height:900px; position: absolute;overflow-x:hidden !important;-webkit-overflow-scrolling:touch !important;" src="http://www.flipbeets.com/display-embed-code/ZG9sY2VnYWJiYW5h/OTAwcHg=/OTAwcHg=/MQ==/MQ==/MQ=="></iframe>
</div>
</body>
</html>