<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name = 'keywords' content="">
<meta name = 'descriptioon' content=“jQuery、jQury UI、jQuery Mobile”>
<title>jQuery、jQury UI、jQuery Mobile</title>
<script type="text/javascript" src='js/jquery-2.2.1.min.js'></script>
</head>
<body>
<!--
第一章、jQuery入门
1、不用在HTML代码中混杂大量的onclick属性,可以使用jQuery选取所有需要响应click事件的元素并在其上绑定事件处理程序。
2、避免在HTML页面中直接嵌入CSS和Javascript
3、each迭代数组
$("p").each(function(index.el){
$(el).
})
4、map
arr = $.map(arr,function(val,index){
return "" + value;
})
1.6使用数组元素
1.get()
2.[]
1.7index获取元素位置
1.8、grep()在数组中查找元素
var array = $.grep(arr,function(value,index){
return value.indexOf("r")>=0;
})
1.14、使用extend扩展对象
var newObj = $.extend({},obj1,obj2);
第二章、选取元素
2.2 filter()优化选取集
.filter(":odd").
2.3 find() children()
2.4 has() is()
2.8 coutains() 包含某文字的元素
第三章 修改页面
3.2 removeClass
addClass
3.4 attr 只能用于attribute值
prop 只能读取property值
第四章
4.2在画布上绘图
<h2>Draw in the canvas</h2>
<canvas id = "target" width="450" height="450" style="border: 1px solid red;"></canvas>
<script type="text/javascript">
$(document).ready(function(){
var context = $("#target")[0].getContext("2d");
var draw = false;
$("#target").mousedown(function(){
draw = true;
}).mouseup(function(){
draw = false;
}).mouseout(function(){
draw = false;
}).mousemove(function(event){
var pos = $(this).position();
if(draw){
context.fillRect(event.pageX-pos.left,event.pageY-pos.top,2,2);
}
})
})
</script>
4.6、live die
4.7 delegate
第五章 与服务器通信
5.2 get
5.3 $().load("...html");
5.4 promise
-->
</body>
</html>