我在我的網站上使用了Colorbox,在大多數頁面上它工作得很好。但是在其他jQuery腳本正在使用的頁面上,它失敗了。jQuery腳本僅適用於某些頁面
我得到這個錯誤從IE的控制檯:
SCRIPT438: Object doesn't support property or method 'colorbox'
這是給我的麻煩
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('.test').colorbox({iframe:true, width:"50%", height:"75%", top:50, scrolling:false, onComplete:true});
});
</script>
頭片:
<link rel="stylesheet" type="text/css" href="http://www.domain.com/js/calendar/calendar-win2k-1.css" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/styles.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/base/default/css/widgets.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/default/aw_blog/css/style.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/default/onsale/css/product_onsale_label.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/default/onsale/css/category_onsale_label.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/sidenav.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/sidenavcollapse.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/faq/label.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/mageworx/modalbox.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/icart.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/default/css/prolabel.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/colorbox.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/print.css" media="print" />
<script type="text/javascript" src="http://www.domain.com/js/jquery/jquery.1.8.2.min.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/colorbox/jquery.colorbox-min.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/jquery/jquery.noconflict.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/prototype/prototype.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/lib/ccard.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/prototype/validation.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/scriptaculous/builder.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/scriptaculous/effects.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/scriptaculous/dragdrop.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/scriptaculous/controls.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/scriptaculous/slider.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/varien/js.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/varien/form.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/varien/menu.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/mage/translate.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/mage/cookies.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/aw_onsale/onsale.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/mageworx/modalbox.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/mageworx/icart.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/varien/product.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/calendar/calendar.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/calendar/calendar-setup.js"></script>
<script type="text/javascript" src="http://www.domain.com/skin/frontend/default/default/js/sidenavcollapse.js"></script>
<script type="text/javascript" src="http://www.domain.com/skin/frontend/default/default/js/faq/faq.js"></script>
<script type="text/javascript" src="http://www.domain.com/skin/frontend/base/default/js/bundle.js"></script>
<link rel="canonical" href="http://www.domain.com/" />
難道某種衝突?
這可能是一個衝突,但我們無法從中看出。您必須向我們展示此頁面的頭部,以便我們瞭解還有哪些內容正在加載。也可能是jQuery沒有加載到這些頁面上。 – isherwood
可能想看看[jQuery.noConflict()](http://api.jquery.com/jQuery.noConflict/) –
我現在已經從網站添加了頭像。 有趣的是,它只是給了我麻煩,在某些頁面上已經存在另一個jQuery腳本。如果它很重要,那是我正在運行的一個Magento商店。 –