幽灵线程 发表于 2013-1-29 08:52:33

jQuery与prototype.js兼容性问题解决方案

示例代码:
1、在页面中先引入jquery.js,然后通过“jQuery=$;”语句,使用“jQuery”代替$,最后再引入prototype.js。

<script type="text/javascript" src="<html:rewrite page='/js/jquery/jquery.js'/>"></script><script type="text/javascript">jQuery=$;</script><script src="<html:rewrite page='/js/prototype.js'/>" type="text/javascript"></script>2、使用jquery的js代码中,使用"jQuery"代替"$"。
 

jQuery(document).ready(function() {jQuery("").keypress(function(){……});});
页: [1]
查看完整版本: jQuery与prototype.js兼容性问题解决方案