Home > Web Front-end > JS Tutorial > body text

How to check whether the webpage is loading jquery

藏色散人
Release: 2023-01-04 09:38:06
Original
2441 people have browsed it

How to check whether the webpage is loading jquery: first create a code sample file; then use the statement "if(typeof jQuery != 'undefined'){...}" to determine whether jquery is loaded.

How to check whether the webpage is loading jquery

The operating environment of this tutorial: windows7 system, jquery1.7.2&&html5 version, Dell G3 computer.

Recommended: jquery video tutorial

Directly upload the code, if you don’t believe me, test it yourself.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<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 != &#39;undefined&#39;) {
alert("jquery已经被加载");
} else {
alert("jquery没有被加载");
}
</script>
</body>
</html>
Copy after login

Mainly talk about two points:

1. There are pictures and the truth

How to check whether the webpage is loading jquery

How to check whether the webpage is loading jquery

2. You can determine whether to import it by annotating jquery.

The above is the detailed content of How to check whether the webpage is loading jquery. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template