javascript-未捕获的TypeError:对象[object Object]没有方法’attachEvent’

试图使灯箱在我的服务器上工作,但出现了eseese 2错误

Uncaught TypeError: Object [object Object] has no method ‘attachEvent’ prototype.js:6490
Uncaught TypeError: Object [object Object] has no method ‘dispatchEvent’ prototype.js:6598

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> 
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="\Content\js\lightBox.js"></script>
<link rel="stylesheet" href="\Content\css\lightBox.css" type="text/css" media="screen">

解决方法:

您可以将jQuery绑定到您分配的变量上,以消除发生的所有冲突,正如alex在评论中所说的…例如,从jQuery website

// Line that tells jQuery to bind to "j" and not $
var j = jQuery.noConflict();

// Do something with jQuery
j( "div p" ).hide();

// Do something with another library's $()
$( "content" ).style.display = "none";

显然,将代码更改为您的首选项,此代码只是一个示例.

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...