我正在尝试同时使用 jQuery 和 Prototype。
我花了几个小时寻找解决方案来解决这个问题。我发现的最常见的方法是这个http://docs.jquery.com/Using_jQuery_with_Other_Libraries。但是,无论我如何放置“jQuery.noConflict()”代码,它都不起作用。
谁能帮我这个?
提前致谢
这是我的代码
<script type="text/javascript" src="/js/swfobject.js">
</script>
<script type="text/javascript" src="/js/layerswitch.js">
</script>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2351815-2";
urchinTracker();
</script>
<script type="text/javascript" src="/js/jquery-1.3.2.min.js">
</script>
<script type="text/javascript" src="/js/fadeLinks.js">
</script>
<script>
jQuery.noConflict();
jQuery(document).ready(function($){
$("#example").autocomplete(options);
});
</script>
<script src="js/prototype.js" type="text/javascript">
</script>
<script src="js/scriptaculous/scriptaculous.js" type="text/javascript">
</script>
<script src="js/recommended_items.js" type="text/javascript">
</script>
<script type="text/javascript">
//<![CDATA[
Event.observe(window, 'load', function() {
var recommended_items = new RecommendedItems('recommended_items', <?="$store_id, $gift_registry_id" ?>);
recommended_items.setBaseURL('<?=$site_server . SITE_STANDARD ?>');
<?php if (THIS_PAGE == PRODUCT_PHP) { ?>
recommended_items.setProduct(<?="$product_id, $category_id" ?>);
<?php } ?>
recommended_items.fetchItems();
});
//]]>
</script>