Blogger Information
Blog 14
fans 0
comment 0
visits 8373
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
4月2日作业
王报喜的博客
Original
608 people have browsed it

 引入jquery的两种方式:

 1.cdn在线版本,百度搜索“百度静态资源库”这个网址http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js

用scrip引入

例:<script type='text/javascript' src='http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js'></script>

2.下载下来引入,在官网下载编程版本,把他放到html的项目中的js的文件夹中

例:<scrip type='textt/javascript' src='js/jquery-3.3.1.js'></scrip>



为什么要用 $(document).ready(function(){})  因为如果把script的放到head头部文件中,他的jq代码无法生效检测不到,所以要加上这个参数等页面执行完之后

在启用它,就会检测到页面元素了,效率高,如果把script放到文档页尾就可以了不用加他了

他的写法是:

<html>

<head>

<script type="text/javascript" src=''js/jquery-3.3.1.js''></script>

<script type="text/javascript">


$(document)

</script>

</head>

</html>



Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post