[jQuery] Introduction
来源:互联网 发布:北京赛车pk10数据分析 编辑:程序博客网 时间:2024/05/22 08:17
1. $()=jQuery()
$()=jQuery()eg: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script> 或者 <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.min.js"></script> $("div").css('color', 'red');
2. 加载模式
$(function()); 使用包裹代码是因为:
jQuery库文件是在body之前加载的,必须等到所有DOM加载完成之后,延迟DOM的操作,否则无法获取到 (1) window.onload=function(){}; 全部内容(DOM+CSS+pic+js) 等到网页全部内容加载完成后(pic etc), 再执行代码 (2) $(document).ready(function(){}); DOM结构 等到网页的DOM结构接在完成 很少去使用window.onload 因为 需要等待pic等大量元素加载完后 再去执行。 如果pic很大, 网速很慢, js就会处于假死状态。
0 0
- JQuery Introduction
- [jQuery] Introduction
- JQuery Learning(1):JQuery introduction
- Using jQuery in PeopleSoft: Introduction
- Introduction
- Introduction
- Introduction
- Introduction
- Introduction
- Introduction
- Introduction
- Introduction
- Introduction
- Introduction
- introduction
- Introduction
- Introduction
- introduction
- 遇到的问题----js获取java的数组
- ceph安装命令罗列
- HighCharts中PieChart的实现
- mark
- socket的发送与接收缓冲区
- [jQuery] Introduction
- 1.Two Sum
- [mysql] 性能优化20条建议
- CSS中背景颜色的渐变
- markdown语法学习
- jsonp跨域问题【主要解决的是返回状态码是200,但是js脚本仍然是执行error模块问题】
- QT开发中遇到的奇葩错误
- Xcode真机测试could not find developer disk image解决方法
- Spring MVC配置及HandlerMapping/HandlerAdapter接口