Created
July 15, 2014 00:21
-
-
Save jikeytang/c7ad5e669dd87752a646 to your computer and use it in GitHub Desktop.
[ jQuery ] - 20140715-题目1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
请说出以下的区别: | |
1. $.get(), $.post() | |
2. closest, parent, parents, parentsUtil, offsetParent | |
3. offset, position, | |
4. find, children, filter, siblings | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
20140715-题目1
请说出以下的区别:
HTTP 请求:GET vs. POST
两种在客户端和服务器端进行请求-响应的常用方法是:GET 和 POST。
GET - 从指定的资源请求数据
POST - 向指定的资源提交要处理的数据
GET 基本上用于从服务器获得(取回)数据。注释:GET 方法可能返回缓存数据。
POST 也可用于从服务器获取数据。不过,POST 方法不会缓存数据,并且常用于连同请求一起发送数据。
參考網址:http://www.w3school.com.cn/jquery/jquery_ajax_get_post.asp
closest, parent, parents, parentsUtil, offsetParent
jQuery 遍历函数網址:http://www.w3school.com.cn/jquery/jquery_ref_traversing.asp
.closest() 从元素本身开始,逐级向上级元素匹配,并返回最先匹配的祖先元素。
.parent() 获得当前匹配元素集合中每个元素的父元素,由选择器筛选(可选)。
.parents() 获得当前匹配元素集合中每个元素的祖先元素,由选择器筛选(可选)。
.parentsUntil() 获得当前匹配元素集合中每个元素的祖先元素,直到遇到匹配选择器的元素为止。
.offsetParent() 获得用于定位的第一个父元素。
offset, position,
offset() 方法返回或设置匹配元素相对于文档的偏移(位置)。
參考網址:http://www.w3school.com.cn/jquery/css_offset.asp
position() 方法返回匹配元素相对于父元素的位置(偏移)。
參考網址:http://www.w3school.com.cn/jquery/css_position.asp
find, children, filter, siblings
jQuery 遍历函数網址:http://www.w3school.com.cn/jquery/jquery_ref_traversing.asp
find() 获得当前匹配元素集合中每个元素的后代,由选择器进行筛选。
children() 获得匹配元素集合中每个元素的所有子元素。
filter() 方法将匹配元素集合缩减为匹配指定选择器的元素。
參考網址:http://www.w3school.com.cn/jquery/traversing_filter.asp
siblings() 获得匹配元素集合中所有元素的同辈元素,由选择器筛选(可选)。