有没有办法在一个HTML文件中包含一个HTTP请求(包含text/html或text/plain)的内容?当然,这可以通过AJAX或在服务器端完成,但我对纯粹的浏览器HTML方式感兴趣。也许使用<link>
标记,或者我不熟悉的一些HTML5方法?如何从纯html加载html文本?
例如: 的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>
otherResource.html:
<p>This is from another resource</p>
我认为这是最好的非代码方式。 – nycynik