我在一个页面中遇到了与2个javascript调用的冲突,并想知道是否有人可以发现如何修复它..
以下是this page here的html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--#include virtual="/Assets/Templates/Public/Franchise/HeadCSS.asp"-->
<!-- jQuery library (served from Google) -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<!-- bxSlider Javascript file -->
<script type="text/javascript" src="/js/bxslider/jquery.bxslider.min.js"></script>
<!-- bxSlider CSS file -->
<link rel="stylesheet" href="/js/bxslider/jquery.bxslider.css" type="text/css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js"></script>
<link type="text/css" href="/js/pikame/styles/bottom.css" rel="stylesheet" />
<script type="text/javascript" src="/js/pikame/lib/jquery.jcarousel.min.js"></script>
<script type="text/javascript" src="/js/pikame/lib/jquery.pikachoose.js"></script>
</head>
<body id="home">
<!--#include virtual="/Assets/Templates/Public/Franchise/Home.asp"-->
<h1>Latest in Brentwood</h1>
<div>
<ul id="pikame">
<li><img src="http://bxslider.com/images/170_200/trees.jpg" /><div style="text-align:center;"><h3>Trees</h3><span style="display:block">Italian</span></li>
<li><img src="http://bxslider.com/images/170_200/tree_root.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/hill_road.jpg" /></li>
</ul>
<script>$(function(){ $('#pikame').pikachoose(); });</script>
</div>
<h2>Featured Brentwood Restaurants</h2>
<ul class="bxslider">
<li><img src="http://bxslider.com/images/170_200/trees.jpg" /><div style="text-align:center;"><h3>Trees</h3><span style="display:block">Italian</span></li>
<li><img src="http://bxslider.com/images/170_200/tree_root.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/hill_road.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/me_trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/hill_trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/mountain.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
</ul>
<h2>Featured Brentwood Spa and Beauty</h2>
<ul class="bxslider">
<li><img src="http://bxslider.com/images/170_200/trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/tree_root.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/hill_road.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/me_trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/hill_trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/mountain.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
</ul>
<h2>Featured Brentwood Shopping</h2>
<ul class="bxslider">
<li><img src="http://bxslider.com/images/170_200/trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/tree_root.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/hill_road.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/me_trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/hill_trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/mountain.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
</ul>
<h2>Featured Brentwood Tradesmen</h2>
<ul class="bxslider">
<li><img src="http://bxslider.com/images/170_200/trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/tree_root.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/hill_road.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/me_trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/hill_trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/mountain.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
</ul>
<h2>Featured Brentwood Bars and Clubs</h2>
<ul class="bxslider">
<li><img src="http://bxslider.com/images/170_200/trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/tree_root.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/hill_road.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/me_trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/hill_trees.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/mountain.jpg" /></li>
<li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
</ul>
<script type="text/javascript">
$(document).ready(function(){
$('.bxslider').bxSlider({
minSlides: 3,
maxSlides: 4,
slideWidth: 170,
slideMargin: 10
});
});
</script>
<!--#include virtual="/Assets/Templates/Public/Franchise/TemplateEnd.asp"-->
</body>
</html>
<!--#include virtual="/System/Shutdown.asp"-->
你可以看到有2个javascript电话,第一个是取消第二个..任何想法都会很棒。
答案 0 :(得分:2)
你包括jQuery两次。
删除该行:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js"></script>
答案 1 :(得分:0)
试试这个:
<head>
<!--#include virtual="/Assets/Templates/Public/Franchise/HeadCSS.asp"-->
<!-- jQuery library (served from Google) -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="/js/pikame/lib/jquery.jcarousel.min.js"></script>
<script type="text/javascript" src="/js/pikame/lib/jquery.pikachoose.js"></script>
<!-- bxSlider Javascript file -->
<script type="text/javascript" src="/js/bxslider/jquery.bxslider.min.js"></script>
<!-- bxSlider CSS file -->
<link rel="stylesheet" href="/js/bxslider/jquery.bxslider.css" type="text/css" />
<link type="text/css" href="/js/pikame/styles/bottom.css" rel="stylesheet" />
</head>