试图使灯箱在我的服务器上工作,但出现了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";
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。