Ajax/jQuery -在页面加载时将网页内容加载到div中?
16lz
2021-01-22
Without using iframes, is it possible to load the contents of
不使用iframe,是否有可能装入
<div id="siteloader"></div>
With an external site e.g. somesitehere.com
有一个外部网站,例如somesitehere.com
When the page loads? - I know how to load contents from a file, but wasn't sure how to load a whole site?
当页面加载?-我知道如何从文件中加载内容,但不知道如何加载整个站点?
Many thanks,
非常感谢,
4 个解决方案
#1
47
This is possible to do without an iframe
specifically. jQuery is utilised since it's mentioned in the title.
这可以在没有iframe的情况下实现。由于标题中提到了jQuery,所以使用了jQuery。
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Load remote content into object element</title>
</head>
<body>
<div id="siteloader"></div>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
$("#siteloader").html('<object data="http://tired.com/">');
</script>
</body>
</html>
更多相关文章
- [置顶] JQuery datatables 使用Fixedcolumns固定列控件
- 点击JSON数据加载Galleria画廊。我需要新鲜的眼睛来看我的错误
- 在执行ajax时显示加载图像
- jQuery实例(ajax通信和动态加载二级菜单)
- 当AJAX响应来自PHP文件时,如何显示以消息为中心的加载器图像&防止
- 通过jQuery设置全局Ajax加载时呈现Loading
- jQuery Ui Draggable在移动端浏览器不起作用解决方案
- 加载函数加载页面但不能对数据执行任何操作
- jquery lazyload延迟加载技术的实现原理分析