Javascript 一页上有多个jQuery
我对jQuery非常陌生,在这方面遇到了一些问题。我想使用一个简单的sideshow和一个weather插件,但由于某些原因,当我同时实现它们时,它们都不起作用Javascript 一页上有多个jQuery,javascript,jquery,plugins,slideshow,weather,Javascript,Jquery,Plugins,Slideshow,Weather,我对jQuery非常陌生,在这方面遇到了一些问题。我想使用一个简单的sideshow和一个weather插件,但由于某些原因,当我同时实现它们时,它们都不起作用 <script src="js/jquery.js"></script> <script src="js/fadeSlideShow-minified.js" type="text/javascript"></script> <script type="text/javascript
<script src="js/jquery.js"></script>
<script src="js/fadeSlideShow-minified.js" type="text/javascript"></script>
<script type="text/javascript" src="js/fadeSlideShow.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="jquery.zweatherfeed.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#slideshow').fadeSlideShow();
});
</script>
<script type="text/javascript">
$(document).ready(function () {
$('#test').weatherfeed(['1580050']);
});
</script>
$(文档).ready(函数(){
$(“#幻灯片放映”).fadeSlideShow();
});
$(文档).ready(函数(){
$('#test')。weatherfeed(['158050']);
});
每页只需要一个jQuery版本
// This is one
<script src="js/jquery.js"></script>
<script src="js/fadeSlideShow-minified.js" type="text/javascript"></script>
<script type="text/javascript" src="js/fadeSlideShow.js"></script>
// This is another - delete this one.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="jquery.zweatherfeed.min.js" type="text/javascript"></script>
//这是一个
//这是另一个-删除这一个。
您也不需要fadeSlideShow的缩小版和未缩小版,每页只需要一个jQuery版本
// This is one
<script src="js/jquery.js"></script>
<script src="js/fadeSlideShow-minified.js" type="text/javascript"></script>
<script type="text/javascript" src="js/fadeSlideShow.js"></script>
// This is another - delete this one.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="jquery.zweatherfeed.min.js" type="text/javascript"></script>
//这是一个
//这是另一个-删除这一个。
您也不需要fadeSlideShow的缩小版和未缩小版,只需包含jquery库一次。删除此行
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
只需包含jquery库一次。删除此行
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
您似乎正在加载两个版本的jQuery和两个fadeSlideShow文件,请尝试以下操作:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="js/fadeSlideShow-minified.js" type="text/javascript"></script>
<script src="jquery.zweatherfeed.min.js" type="text/javascript"></script>
此外,如果您检查JavaScript控制台以查看是否出现任何错误消息,并向我们提供HTML代码,也会有所帮助。您似乎正在加载两个版本的jQuery和两个fadeSlideShow文件,请尝试以下操作:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="js/fadeSlideShow-minified.js" type="text/javascript"></script>
<script src="jquery.zweatherfeed.min.js" type="text/javascript"></script>
此外,如果您检查JavaScript控制台以查看是否出现任何错误消息,并向我们提供HTML代码,也会有所帮助。中的数字是多少
$('#test').weatherfeed(['1580050']);
如果是WOEID,您必须这样使用它:
$('#test').weatherfeed(['44418'],{
woeid: true
});
这意味着,你必须对你的插件说,你使用的定位服务与默认的不同
为什么要实现多个jQuery库?尝试上一个jQuery版本(2.0或1.10.2)
原因有很多,为什么它不能工作
希望对您有所帮助。您的电话号码是多少
$('#test').weatherfeed(['1580050']);
如果是WOEID,您必须这样使用它:
$('#test').weatherfeed(['44418'],{
woeid: true
});
这意味着,你必须对你的插件说,你使用的定位服务与默认的不同
为什么要实现多个jQuery库?尝试上一个jQuery版本(2.0或1.10.2)
原因有很多,为什么它不能工作
希望对您有所帮助。您已经包括在内
fadeSlideShow-minified.js和fadeSlideShow.js
在你的剧本里,我认为他们是一样的。因为fadeSlideShow-minified.js是fadeSlideShow.js的最小版本,所以只需从页面中删除js/fadeSlideShow.js的脚本标记并进行检查。现在应该可以用了。您已经包括了
fadeSlideShow-minified.js和fadeSlideShow.js
在你的剧本里,我认为他们是一样的。因为fadeSlideShow-minified.js是fadeSlideShow.js的最小版本,所以只需从页面中删除js/fadeSlideShow.js的脚本标记并进行检查。它现在应该可以工作了。好的,刚才看到您包含了两个jquery版本,为什么?如果某些插件使用较旧的jq版本,只需迁移它即可。在同一上下文页面上使用多个jquery版本从来都不是一个好主意。。。而且您似乎也包含了两次fadeSlideShow,又一次是错误的……看起来您包含了一些文件两次,一次是未压缩的变体(
js/jquery.js
,js/fadeSlideSho.js
),另一次是缩小的变体(http://ajax.googleapis.com/ajax/libs/jquey/1.7.1/jquery.min.js
,js/fadeSlideShow minified.js
)。我已经综合了所有人的评论。我的slimpleslideshow现在可以运行了,但是天气插件不起作用。这里有一个链接让你有更多的想法-它还在进行中:creatiff.co.za/emilling/index.htmlOk,刚刚看到你包含了两个jquery版本,为什么?如果一些插件使用旧的jq版本,就迁移它。使用多个jquery同一个上下文页面上的版本从来都不是一个好主意……而且您似乎也包含了两次fadeSlideShow,又一次是错误的……看起来您包含了一些文件两次,一次是未压缩的变体(js/jquery.js
,js/fadeSlideSho.js
),另一次是缩小的变体(http://ajax.googleapis.com/ajax/libs/jquey/1.7.1/jquery.min.js
,js/fadeSlideShow minified.js
)。我已经合并了每个人的评论。我的slimpleslideshow现在可以工作了,但是天气插件不起作用。这里有一个链接让你有更多的想法-它仍在进行中:creatiff.co.za/emilling/index.htmlI已经合并了每个人的评论。我的slimpleslideshow现在可以工作了,但是天气插件不起作用。这里有一个链接让你有更多的想法想法-仍在进行中:我已经整合了所有人的评论。我的slimpleslideshow现在可以工作了,但是天气插件不起作用。下面是一个链接,让你了解更多想法-仍在进行中: