检测jquery是否正确引入


 
1 if(typeof(jQuery)=="undefined"){
2     alert("jQuery is not imported");
3 }else{
4     alert("jQuery is imported");
5 }
将代码复制到script的函数中即可。

例如:
<script type="text/JavaScript">
        function f(){
         if(typeof(jQuery)=="undefined"){
                alert("jQuery is not imported");
            }else{
                alert("jQuery is imported");
            }
}
}
</script>            

 

然后写个Button调用函数即可。
另附几个jquery地址:

Google

<head>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
</head>

 Microsoft

<head>
  <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.min.js"></script>
</head>
baidu
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM