【发布时间】:2015-10-20 23:36:49
【问题描述】:
有没有办法将一个 HTTP 请求的内容(包含 text/html 或 text/plain)包含在另一个 HTML 文件中?当然,这可以通过 AJAX 或在服务器端完成,但我对纯浏览器 HTML 方式感兴趣。也许使用<link> 标签,或者我不熟悉的一些 HTML5 方法?
例如: index.html:
<!DOCTYPE html>
<html>
<head></head>
<body>
<p>This is my text loaded from the original document</p>
<p>This is text I want to load from another file: <span id="other"><!-- link other resource here --></p></span>
</body>
</html>
其他资源.html:
<p>This is from another resource</p>
【问题讨论】:
标签: html