zoukankan      html  css  js  c++  java
  • jQuery 与 prototype 共存

    方法一:

    <html>  
     <head> 
       <script src="prototype.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="prototype.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="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').style.display = 'none';  
       </script> 
     </head> 
     <body></body> 
     </html> 
  • 相关阅读:
    TCP与UDP在socket编程中的区别
    使用python selenium webdriver模拟浏览器
    Web性能测试参数
    DPDK学习之开篇介绍
    go环境import cycle not allowed问题处理
    使用etcd+confd管理nginx配置
    服务的扩展性
    linux 网络编程
    单片机成长之路(stm8基础篇)- 025 stm8 时钟切换
    单片机成长之路(51基础篇)- 024 基于 N76E003 的按键按键状态机
  • 原文地址:https://www.cnblogs.com/xiaochao12345/p/4191541.html
Copyright © 2011-2022 走看看