阿贾克斯/ jQuery的 - 加载网页内容到页面加载一个div? [英] Ajax/jQuery - Load webpage content into a div on page load?
本文介绍了阿贾克斯/ jQuery的 - 加载网页内容到页面加载一个div?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果不使用内部框架,是有可能加载的内容
Without using iframes, is it possible to load the contents of
<div id="siteloader"></div>
通过外部站点如somesitehere.com
With an external site e.g. 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?
非常感谢,
推荐答案
这是可以做到无 IFRAME
明确。 jQuery是利用,因为它提到的称号。
This is possible to do without an iframe
specifically. jQuery is utilised since it's mentioned in the title.
<!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的 - 加载网页内容到页面加载一个div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文