我将使用引导程序来构建我的前端。我也在使用 JSP 和 JSTL
我在互联网上的一些文章中读到的是,添加外部 JavaScript 文件的正确方法应该写在正文结束标记之前,以便对页面进行更多优化。现在我正在尝试将其与引导程序一起应用,我所做的就是将css
引导程序的内容放到外部 html 文件中:
import_header.html:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="bootstrap-css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="bootstrap-css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="bootstrap-css/bootstrap-responsive.css">
<link rel="stylesheet" type="text/css" href="bootstrap-css/bootstrap-responsive.min.css">
我像这样导入到 html 的头部:
<jsp:include page="import_header.html" flush="true" />
现在我想对js
bootstrap 和jQuery
lib 的文件做同样的事情,但我不知道这样做的正确方法是什么。