在FF3.0中加载我的索引页面时,我得到了以下错误。对不起,我无法在这里粘贴脚本,因为它是2030行代码。
element.dispatchEvent不是一个函数
在扩展时,它给了我下面的东西,
fire()()prototype.js?1 (第3972行)
_methodized()()prototype.js?1 (第246行)
fireContentLoadedEvent()prototype.js?1 (4006行)
在此错误事件上中断(element.dispatchEvent);
element.dispatchEvent(event);
在prototype.js的第3972行。我在我的索引页面中包含了prototype.js和其他10个js文件。
有没有人遇到过这种错误?请给我解释一下为什么会出现这个错误。
发布于 2009-07-16 02:50:23
您是否碰巧在同一个页面上使用jquery和prototype?
如果是这样,请使用jquery函数模式,否则您将覆盖原型$ noConflict。
通过执行以下操作激活noConflict模式:
<script src="jquery.js"></script>
<script>jQuery.noConflict();</script>
注意:通过这样做,美元符号变量不再表示jQuery对象。为了避免重写所有jQuery代码,您可以使用这个小技巧为jQuery创建一个美元符号作用域:
jQuery(function ($) {
// The dollar sign will equal jQuery in this scope
});
// Out here, the dollar sign still equals Prototype
发布于 2013-08-21 03:58:49
在添加了所有Jquery脚本标记之后
<script>jQuery.noConflict();</script>
避免Prototype和Jquery之间的冲突。
发布于 2017-11-22 15:28:18
更改以下行
$(document).ready(function() {
至
jQuery.noConflict();
jQuery(document).ready(function($) {
https://stackoverflow.com/questions/980697
复制相似问题