Download and introduction of jQuery
1.jQuery is a js function library, which can greatly simplify the writing of js code
2.jQuery is essentially an ordinary js file. Just download and import it into the project
3. Download the development version from the official website for learning. After the project is online, change it to the generated environment compressed version
4. You can choose local files or use cdn online Version, domestically it is recommended to use baidu static resource library, access speed is fast
5. The big boss in jQuery is the factory function $(), we will start the jQuery learning journey from this guy
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>2.jQuery的下载与引入</title> </head> <body> <!-- 任务:点击文本,弹出它对应的域名 --> <h2>php中文网</h2> <!-- 在使用jquery之前,一定要将js库先引入 --> <!-- <script type="text/javascript" src="../js/jquery-3.3.1.js"></script> --> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> <!-- 现在就可以直接痛快的写js代码啦 --> <script type="text/javascript"> $('h2').click(function(){ alert('www.php.cn') }) </script> </body> </html>
The above is the detailed content of Download and introduction of jQuery. For more information, please follow other related articles on the PHP Chinese website!