问题
If i use locally Installed bootstrap.min.js file. Its not working
**If i use Bootstrap.min.js CDN then its work i did not understood what is difference between ? **
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
I used
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js
link downloaded ..
Same file i used local and CDN... CDN works but locally downloaded not worked. I dont know how Please help. Same problam i faced many time
Consol Error Shows
My path is correct .. js Folder in the same directory as careers.php,
Inside JS folder content
** Edit I use Jquery: jquery-3.2.1.min.js (its not working). then i use as you say jquery-2.0.0.min.js (its works)..HOW..latest version is 3.2.1 Then why consol error show: Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3**
回答1:
Check the file path on local. To verify the current issue, Inspect Element in your browser and you will see unable to load file in console. Once you include it via correct path, it will work.
js/bootstrap.min.js
Needs to be replaced with correct path.
Edit after you posted Browser console screenshot Most probably you have downloaded old js file. Download file from This Link and then try. This file contains the exception
Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4
that leads me to believe you have downloaded old JS file.
回答2:
From the console errors, I can see that Bootstrap doesn't support jQuery v3 and intentionally throws an error.
Uncaught Error: Boostrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3
Make sure to include jQuery v2 instead and that should hopefully resolve that issue.
Absolute and relative linking
When you load the script via the CDN, that is a resource maintained by the publisher and is an absolute path to the file. This means it can be referenced from any location (from /
, from /blog
, anywhere).
When just referencing the file, you're loading it path-relatively. It needs to be in the same directory as the base URL (https://developer.mozilla.org/en/docs/Web/HTML/Element/base). By default, this is the URL (ie. /blog
).
Make sure that you have the folder js
in the same directory as careers.php
, and within that folder you have the bootstrap.min.js
file. Otherwise web browsers won't be able to find it.
Alternatively, you can make the URL root-relative. In other words, you can put a /
in front of the path (/js/bootstrap.min.js
) and make sure that the folder is at the top of your public directory.
Here's some info on absolute vs relative links: http://www.dirigodev.com/blog/seo-web-best-practices/relative-vs-absolute-urls-seo/
回答3:
I seem to recall suffering a similar issue, where I managed to download bootstrap.min.js (v3.3.7) that was configured to look for jquery versions below 3, when bootstrap v3.3.7 states that it has jquery v3 support included http://blog.getbootstrap.com/2016/07/25/bootstrap-3-3-7-released/
I suggest you edit / view the bootstrap.min.js that you've downloaded and search for "but lower than version" which you should find in the first couple of lines. It should say "Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4". If not, I suggest you download the code from here http://getbootstrap.com/docs/3.3/getting-started/#download.
来源:https://stackoverflow.com/questions/45893194/bootstrap-locally-installed-bootstrap-min-js-not-working-but-bootstrap-min-js-c