且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery和放大器;原型冲突

更新时间:2023-01-23 20:01:31

有两种可能的解决方案:有使用旧版本是Scriptaculous和jQuery的冲突(Scriptaculous的企图不正确地扩展本机阵列原型) - 第一次尝试升级Scriptaculous的副本。

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.

如果不工作,你需要使用 noConflict()(如上面提到的)。但是,有一个问题。既然你包括一个插件,你需要做的包括以特定的顺序,例如:

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="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.