Jquery与Mootools共存冲突如何解决?

 

方法一:

 
<html>  
  <head>  
    <script src="Mootools.js"></script>  
    <script src="jquery.js"></script>  
    <script>  
      jQuery.noConflict();  
 
      // Use jQuery via jQuery(...)  
      jQuery(document).ready(function(){  
        jQuery("div").hide();  
      });  
 
      // Use Prototype with $(...), etc.  
      $('someid').style.display = 'none';  
    </script>  
  </head>  
  <body></body>  
  </html>

方法二:
 

 
   <html>  
  <head>  
     <script src="Mootools.js"></script>  
     <script src="jquery.js"></script>  
    <script>  
      var $j = jQuery.noConflict();  
 
      // Use jQuery via $j(...)  
        $j(document).ready(function(){  
        $j("div").hide();  
        });  
 
      // Use Prototype with $(...), etc.  
       $('someid').style.display = 'none';  
    </script>  
  </head>  
  <body></body>  
  </html>

方法三:

 
  <html>  
   <head>  
     <script src="Mootools.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').style.display = 'none';  
     </script>  
   </head>  
   <body></body>  
   </html>

 

 



文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: jquery Mootools 共存冲突 如何解决
相关日志:
评论: 0 | 引用: 0 | 查看次数: -
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.