Reputation: 23
I begin to use Bootstrap. And I add js/bootstrap.min.css
to my index.html
and all works.
But, when I add bootstrap.min.js
to index.html
,my, for example, dropdown menu doesn't work.
But, when I add http://code.jquery.com/jquery-latest.js
- my dropdown menu works.
I want to work with menu without connecting to Internet. Why?
Upvotes: 0
Views: 10184
Reputation: 13805
Instead of using cdn path in your index.html like this
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<!--Latest JQuery CDN Link -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-beta1/jquery.js"></script>
try using relative path after downloading the required files as below:
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!--Latest JQuery CDN Link -->
<script src="js/jquery.js"></script>
In your case jquery-latest.js
must be downloaded from given link and included in index.html using relative path.
Upvotes: 0
Reputation: 3242
you should download the script at your local system and put the script at in your project JS OR Script folder and call it from there.
like that:
<script type="text/javascript" src="/Scripts/jquery-latest.js"></script>
hopefully it works :)
Thanks
Upvotes: 1
Reputation: 2020
Here we go:
1) You are using jQuery library but not bootstrap
2) if you want to download bootstrap library to local, you will get from here : enter link description here
Upvotes: 0
Reputation: 949
Bootstrap uses jquery
, since your need to use it without internet download the jquery file and put it inside JS folder and serve it to index.html
Upvotes: 0
Reputation: 368
Bootstrap:
http://getbootstrap.com/getting-started/
JQuery:
http://www.w3schools.com/jquery/jquery_get_started.asp
Download and link the files correctly via relative paths.
Upvotes: 0