amy-1205
jQuery 分 2 个系列版本 1.x 与 2.x,主要的区别在于 2.x 不再兼容 IE6、7、8浏览器,这样做的目的是为了兼容移动端开发。由于减少了一些代码,使得该版本比 jQuery 1.x 更小、更快。
如果开发者比较在意老版本 IE 用户,只能使用 jQuery 1.9 及之前的版本了。
jQuery是一个JavaScript脚本库,不需要特别的安装,只需要我们在页面 <head> 标签内中,通过 script 标签引入 jQuery 库即可。

 1 <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
 2 <script>
 3         //        第一种写法
 4         $(function(){
 5             $("div").html("");
 6 //        add your code here
 7         })
 8 
 9         //        第二种写法
10         $(document).ready(function(){
11             $("div").html("");
12             $("a").click(function(){
13 // add your code here
14             })
15         })
16 
17         //        第三种写法
18         window.onload = function(){
19 //       add your code here
20                 }
21     </script>

分类:

技术点:

相关文章:

  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
猜你喜欢
  • 2022-12-23
  • 2021-12-12
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2021-10-25
相关资源
相似解决方案