码迷,mamicode.com
首页 > Web开发 > 详细

如何判断网页中引入jquery

时间:2016-10-09 13:25:34      阅读:143      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!