首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

jquery 与prototype 矛盾结局方案

2012-10-07 
jquery 与prototype 冲突结局方案一种代码示例:思想是采用闭包,先将jquery使用的$释放,然后在用闭包引入$

jquery 与prototype 冲突结局方案
一种代码示例:
  思想是采用闭包,先将jquery使用的$释放,然后在用闭包引入$这样,两个框架都可以使用$了。

<html> <head>   <script src="/prototype.js"></script>   <script src="/jquery.js"></script>   <script>   jQuery.noConflict();     // Put all your code in your document ready area     jQuery(document).ready(function($){       // Do jQuery stuff using $       $("div").hide();     });// Use Prototype with $(…), etc. $('someid').hide(); </script> </head> <body></body> </html>

热点排行