简体   繁体   中英

Conflict with js files

I'm creating a web mashup using qliksense where I'm using some js files and I noticed that when I add the:

  • tether.min.js
  • smooth-scroll.min.js
  • jquery.touchSwipe.min.js

I have a conflict

The other js file are :

  • jquery.min.js
  • popper.min.js
  • bootstrap.min.js
  • jquery.dropdown.min.js
  • jarallax.min.js

I don't know if there is dependecies or even an order to respect.

Help would be great

Thank you

A.

This is the order you need and there will be no conflict:

1- jquery.min.js (required for jquery parts of bootstrap and for jquery.dropdown.min.js)

2- popper.min.js (required for bootstrap dropdown. It has no dependency to nothing!)

3 or 4 or 5: bootstrap.min.js and jquery.dropdown.min.js (only requires jquery) and jarallax.min.js (pure JavaScript with no dependency)

Final note:

if you suspect that there are multiple jquery included in each file, you can name you own jquery and use it like this:

<script src="jquery-2.1.1.js"></script>
<script>
    var myJquery= jQuery.noConflict();
</script>

usage:

myJquery("#myelement")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM