首页 > Web开发 > 详细

如何判断网页中引入jquery

时间:2016-10-09 13:23:28      阅读:240      评论:0      收藏:0      [点我收藏+]

直接上代码,不信自己测。

<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<title>jquery</title>
</head>
<body>
<h5>判断jquery是否加载</h5>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript">
if (typeof jQuery != ‘undefined‘) {
alert("jquery已经被加载");
}
else
{
alert("jquery没有被加载");
}
</script>
</body>
</html>

主要讲两点:

1.有图有真相

技术分享

技术分享

2.通过注释jquery可以判断是否引入。

如何判断网页中引入jquery

原文:http://www.cnblogs.com/tuoxiong/p/5941341.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!