【发布时间】:2020-07-10 03:24:21
【问题描述】:
如果打扰到您,开发人员很抱歉。所以让我们进入这个问题。 伙计们也请考虑我正在使用nodejs和electronjs。 关于目录的简单表示
main-doc
|---src
|---Html
| |---index.html
| |---navbar.html
|
|---svg
| |---home.svg
|
|---js
|---jquery-file.js
jquery 文件被导入到 index.html 以重用导航栏。 所以我的jQuery代码,
$(".navbar-container").load("navbar.html")
console.log($(".icon-container")) // shows no element in console
$(".icon-container").load("../svg/home.svg") // icon-container is in navbar.html
所以我认为由于图标容器位于 navbar.html 中,因此在第二行时未正确加载 执行。在这种情况下,如何使用 jquery 将此 svg 加载到我的代码中?
【问题讨论】:
标签: javascript jquery html node.js