First you need to download JQuery library from http://jquery.com/ then load the jquery library the following way within your html head tags
(首先,您需要从http://jquery.com/下载JQuery库,然后在html head标签中按以下方式加载jquery库)
then you can test whether the jquery is working by coding your jquery code after the jquery loading script
(那么你可以通过在jquery加载脚本之后编写你的jquery代码来测试jquery是否正常工作)
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--LINK JQUERY-->
<script type="text/javascript" src="jquery-3.3.1.js"></script>
<!--PERSONAL SCRIPT JavaScript-->
<script type="text/javascript">
$(function(){
alert("My First Jquery Test");
});
</script>
</head>
<body><!-- Your web--></body>
</html>
If you want to use your jquery scripts file seperately you must define the external .js file this way after the jquery library loading.
(如果要单独使用jquery脚本文件,则必须在加载jquery库之后以这种方式定义外部.js文件。)
<script type="text/javascript" src="jquery-3.3.1.js"></script>
<script src="js/YourExternalJQueryScripts.js"></script>
Test in real time(实时测试)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!--LINK JQUERY--> <script type="text/javascript" src="jquery-3.3.1.js"></script> <!--PERSONAL SCRIPT JavaScript--> <script type="text/javascript"> $(function(){ alert("My First Jquery Test"); }); </script> </head> <body><!-- Your web--></body> </html>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…