73161

Adding bootstrap in HTML

Question:

I'm going to use <a href="http://getbootstrap.com/" rel="nofollow">bootstrap</a> 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:

<b>import_header.html:</b>

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

Answer1:

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>

Recommend

  • Compare Dictionary
  • Gforce min not supported for character in data.table
  • How to call a procedure using NHibernate that returns result from multiple tables?
  • Adjust width of select element according to selected option's width
  • Reduction and collapse clauses in OMP have some confusing points
  • MonoTouch: How to download pdf incrementally as indicated in the Apple slides “Building Newsstand Ap
  • How to have background script and something similar to a default popup?
  • MongoDb aggregation
  • How to attach a node.js readable stream to a Sendgrid email?
  • Listbox within Listbox and scrolling trouble in Windows Phone 7 Silverlight
  • How to use remove-erase idiom for removing empty vectors in a vector?
  • Java: can you cast Class into a specific interface?
  • Get one-time binding to work for ng-if
  • Align navbar back button on right side
  • Volley JsonObjectRequest send headers in GET Request
  • DotNetZip - Calculate final zip size before calling Save(stream)
  • AES padding and writing the ciphertext to a disk file
  • Updating server-side rendering client-side
  • Modifying destination and filename of gulp-svg-sprite
  • How to extract text from Word files using C#?
  • htaccess rewriting URLs with multiple forward slashes
  • Importing jscolor library in angular 2
  • Display Images one by one with next and previous functionality
  • Web-crawler for facebook in python
  • Warning: Can't call setState (or forceUpdate) on an unmounted component
  • How to get icons for entities from eclipse?
  • A cron job substitute?
  • WPF Applying a trigger on binding failure
  • Proper way to use connect-multiparty with express.js?
  • Load html files in TinyMce
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • Free memory of cv::Mat loaded using FileStorage API
  • CSS Applying specific rule for a specific monitor resolution with only CSS is posible?
  • How do I configure my settings file to work with unit tests?
  • Change div Background jquery
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • JaxB to read class hierarchy
  • Easiest way to encapsulate a HTML5 webpage into an android app?
  • Does armcc optimizes non-volatile variables with -O0?
  • Binding checkboxes to object values in AngularJs