0

I want to use Bootstrap via including CDN. According to the documentation, there are three:

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> 

I know that I should include CSS (the 1st) and JavaScript (the 3rd). But do I also need to include JQuery CDN? Or it is already included in Bootstrap CDN?

And what is the optional theme CDN (the 2nd)? Is it necessary to include it if I what to use Bootstrap?

**EDIT:**

Now since I know that I should include JQuery separately, the main problem is:

And what is the optional theme CDN (the 2nd)? Is it necessary to include it if I what to use Bootstrap?

Thanks a lot.

Xiao Liang
  • 763
  • 2
  • 7
  • 12

2 Answers2

0

Yes, you must need to include jquery via CDN or from your server.

I prefer google jQuery CDN which is obviously fast and less chances for network(B'cos of Googles popularity)

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

Also, you can use Cdn js which provides all javascript libraries CDN.

Rohan Kumar
  • 40,431
  • 11
  • 76
  • 106
0

The theme is as it says optional.

It serves as an example of how to theme bootstrap after including the core files.

So you want to include the

  • Core css,
  • jQuery from either the cdnjs or google cdn
  • Core js

Then have your own locally stored css file with your changes in it that would go in the same place as the theme in the head section.

Hailwood
  • 89,623
  • 107
  • 270
  • 423