简体   繁体   English

我的 Javascript 文件自动使用另一个,为什么?

[英]My Javascript File use another automatically, why?

i have the green-audio-player script and slick script.我有绿色音频播放器脚本和流畅的脚本。 My green-audio-player doesn't work.我的绿色音频播放器不工作。 If i delete my slick script, its work fine.如果我删除我的漂亮脚本,它就可以正常工作。

<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/slick.min.js" type="text/javascript"></script>
<script src="js/audioPlayer/audioPlayer.js" type="text/javascript"></script>
</body>
</html>

if i use the audioPlayer in my index.html如果我在 index.html 中使用 audioPlayer

<div class="player">
 <audio crossorigin>
  <source src="mp3/sample.mp3" type="audio/mpeg"></audio>
</div>

But i have a Problem after that.但在那之后我有一个问题。 If i check the code in Google-Browser-Inspector it seems automatically change the audio-player with slick-properties of slick.js File如果我检查 Google-Browser-Inspector 中的代码,它似乎会使用 slick.js 文件的 slick-properties 自动更改音频播放器

<div class="volume__slider slider slick-initialized slick-slider slick- 
 dotted" data-direction="vertical" tabindex="0">
                    <div class="slick-list draggable"></div></div>

Can everyone explain me this magic?大家能解释一下这个魔法吗?

Probably because JQuery is not loaded.可能是因为未加载 JQuery。

Be sure to add the JS file in html before your own script and to wait for it to be ready.请务必在您自己的脚本之前添加 html 中的 JS 文件并等待它准备就绪。

$( document ).ready(function() {
   $('html').addClass(isPoorBrowser ? 'poor-browser' : 'no-poor-browser');
});

doc 文档

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

相关问题 为什么我的 javascript 文件不使用我的文本文件中的数据? - Why does my javascript file not use the data in my text file? 为什么Javascript会自动混合我的颜色? - Why is Javascript automatically blending my colors? 为什么我的javascript文件在一个位置创建文件,但尝试从另一个位置读取文件? - Why is my javascript file creating a file in one location but trying to read it from another? 为什么我的 JavaScript 文件无法从另一个文件访问定义的常量? - Why my JavaScript file can't access defined constant from another file? 为什么我的JavaScript文件无法加载? - Why is my javascript file not loading? 为什么Javascript innerHTML自动在我的字符串中添加引号? - Why Javascript innerHTML add quote automatically to my string? 如何在另一个 javascript 文件中的 javascript 文件中使用 javascript 常量 - How to use javascript constant in javascript file from another javascript file 为什么我的 HTML 文件无法使用我链接的 JavaScript 文件? - Why is my HTML file unable to use the JavaScript file that I have linked? 如何在另一个Javascript文件中使用游戏对象及其功能/变量 - How can I use my game object and its functions/variables in another Javascript File 如何自动将我的自定义javascript文件转换为压缩版本 - How to automatically convert my Custom javascript file to minified version
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM