newbie
newbie

Reputation: 1980

Adding bootstrap in HTML

I'm going to use bootstrap to build up my front end. Also I'm using JSP and JSTL

What I've read in some articles over the internet is the proper approach of adding an external javascript file should be written before the body closing tag for more optimization of the page. Now I'm trying to apply this with the bootstrap, what i did is put the css of the bootstrap to an external html file:

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">

which I imported to the head of the html like this:

<jsp:include page="import_header.html" flush="true" />

Now I want to do the same thing with the js file of the of the bootstrap and the jQuery lib but I don't know what is the proper way of doing this.

Upvotes: 4

Views: 40522

Answers (1)

user2227400
user2227400

Reputation:

that's the recommended way, how to place them:

e.g. footer.html

        <!-- Placed at the end of the document so the pages load faster -->
        <script src="jquery/jquery-2.0.3.min.js"></script>
        <script src="bootstrap/bootstrap-2.3.1.min.js"></script>
        <script src="myOwn.js"></script>
    </body>
</html>

Upvotes: 11

Related Questions