简体   繁体   English

与js文件冲突

[英]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: 我正在使用qliksense创建一个Web mashup,其中使用了一些js文件,当我添加以下内容时,我注意到了这一点:

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

I have a conflict 我有冲突

The other js file are : 另一个js文件是:

  • jquery.min.js jquery.min.js
  • popper.min.js popper.min.js
  • bootstrap.min.js bootstrap.min.js
  • jquery.dropdown.min.js jquery.dropdown.min.js
  • jarallax.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) 1- jquery.min.js(对于引导程序的jquery部分和jquery.dropdown.min.js是必需的)

2- popper.min.js (required for bootstrap dropdown. It has no dependency to nothing!) 2- popper.min.js(引导下拉菜单所需。它与任何东西都不相关!)

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) 3或4或5:bootstrap.min.js jquery.dropdown.min.js(仅需要jquery) jarallax.min.js(纯JavaScript,无依赖性)

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: 如果您怀疑每个文件中包含多个jquery,则可以命名自己的jquery并按以下方式使用它:

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

usage: 用法:

myJquery("#myelement")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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