01-运行后在页面上显示“jQuery is working!”
代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>it is title</title>
<meta name="viewport" content="width=device-width,initial-scale=1, shrink-to-fit=no">
<script src="E:/HTML_code/static/jquery-3.5.1.slim.js"></script>
</head>
<body>
<div id="resultMessage"></div>
<script>
$(document).ready(function() {
$("#resultMessage").text("jQuery is working!");
});
</script>
</body>
</html>
运行后效果如下:
02-运行后在F12调试模式的控制台(Console)打印输出“jQuery is working!”
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>it is title</title>
<meta name="viewport" content="width=device-width,initial-scale=1, shrink-to-fit=no">
<script src="E:/HTML_code/static/jquery-3.5.1.slim.js"></script>
</head>
<body>
<script>
console.log('jQuery is working!');
</script>
</body>
</html>
运行效果如下: