jQuery & Prototype Conflict

There are two possible solutions: There was a conflict with an older version of Scriptaculous and jQuery (Scriptaculous was attempting to extend the native Array prototype incorrectly) – first try upgrading your copy of Scriptaculous.

If that does not work you will need to use noConflict() (as alluded to above). However, there’s a catch. Since you’re including a plugin you’ll need to do the includes in a specific order, for example:

<script src="https://stackoverflow.com/questions/134572/jquery.js"></script>
<script src="jquery.autocomplete.js"></script>
<script>
  jQuery.noConflict();
  jQuery(document).ready(function($){
    $("#example").autocomplete(options);
  });
</script>
<script src="prototype.js"></script>
<script src="effects.js"></script>
<script src="accordion.js"></script>

Hope this helps to clarify the situation.

Leave a Comment