javascript - 如何在 html5 中加载部分 html?

标签 javascript jquery html

<分区>

我正在尝试使用包含链接和 Logo 的部分页面实现 index.html 页面,并根据链接点击更改正文内容。

是否有一个轻量级的 js 库可以让你在 html5 中做到这一点?

最佳答案

使用 jQuery

$('#result').load('ajax/test.html');

http://api.jquery.com/load/

关于javascript - 如何在 html5 中加载部分 html?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18385068/

相关文章:

javascript - react : Calling setState within render method throws error

javascript - 如何在最后一次出现某个字符后获取 url 中的参数

javascript - 在表达式绑定(bind)中使用自定义全局函数

javascript - Google maps geocode API V3 未在 javascript 函数中返回结果

javascript - 如何在模板范围之外使用 Angular 局部变量?

html - 如何将图像放置在两个 div/容器之上?

javascript - 删除和追加 DOM 元素

javascript - 使用javascript显示无序列表中的多个内容项

javascript - 如何使用变量构建有效的 JQuery 选择器

javascript - Jquery 加载忽略对象而不是发布