檢測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