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>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>