【问题标题】:Why my css isn't working and shows problems in console为什么我的 css 无法正常工作并在控制台中显示问题
【发布时间】:2021-07-04 12:10:59
【问题描述】:

您好,我的 css 在 5 分钟前工作时无法正常工作,我真的不知道是什么问题,我在控制台中遇到了这个错误:

bootstrap.min.js:6 Uncaught TypeError: Cannot read property 'fn' of undefined
    at bootstrap.min.js:6
    at bootstrap.min.js:6
    at bootstrap.min.js:6
    at bootstrap.min.js:6
(anonymous) @ bootstrap.min.js:6
(anonymous) @ bootstrap.min.js:6
(anonymous) @ bootstrap.min.js:6
(anonymous) @ bootstrap.min.js:6
DevTools failed to load source map: Could not parse content for http://localhost:8080/GRH/home/assets/js/bootstrap.min.js.map: Unexpected end of JSON input

网络显示一切正常

连链接和路径都很好

【问题讨论】:

  • Bootstrap 依赖于 jQuery
  • 你到底是什么意思?那是什么 ?我该如何解决?
  • 错误消息表明 jQuery 未定义,因为它正在尝试访问 jQuery.fn,这意味着您可能缺少 jQuery
  • bootstrap前需要先加载jquery。
  • 我至少有 50 个 jsp 页面,所以我必须将它添加到每个页面?

标签: javascript css bootstrap-4


【解决方案1】:

去下载JQuery,选择压缩脚本即可 然后在你的引导脚本之前,只需在它之前插入 jquery 脚本

【讨论】:

  • 我至少有 50 个 jsp 页面,所以我必须将它添加到每个页面?
  • ``` ``` 这里是 jquery
  • 这取决于你的项目是如何安排的。如果引导程序应用于所有页面,则 jquery 也必须包含在所有页面中。通常有一个主/模板 html 只保存所有脚本,然后其他页面/路由只使用它并在其中有自己的代码
【解决方案2】:

按“Ctrl+Shift+R”清除 Chrome 缓存,如果不起作用,请在隐身选项卡中打开您的网站。也许它会起作用。

【讨论】:

  • 你可以重命名CSS文件的名字,它会起作用的!
猜你喜欢
  • 2020-09-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多