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,2,3,4,5].copyReverse(); // [1,2,3,4,5,4,3,2,1] | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
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,2,3],[2,3,4,5] -> [1,4,5] | |
[1,2,3], {a:6, b:3} -> [1,2,3, a:6, b:3] | |
就是如何简单实现类jquery的$.extend(true, a, b)的效果。 | |
但与 | |
jQuery.extend(true,[1,2,3],[2,3]) // [2,3,3] | |
区别是题目要求得到是: 2,3,取其中不重复的。 | |
PS: | |
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
以下四种doctype有什么区别,分别对页面有什么影响? | |
<!DOCTYPE html> | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " | |
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" |
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
什么是html标签的语义化?以下各组标签有什么区别? | |
1. strong,b | |
2. em,i | |
3. ul li, ol li,dl dt dd, datalist, nav | |
4. div, p | |
5. article, section, aside | |
6. blockquote, cite, q | |
7. canvas, object, embed | |
8. figure, h1...h6 | |
9. header,main,footer,div |
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
请阐述以下session, cookies, userdata,sessionStorage 和 localStorage 的区别? | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```html | |
// you code | |
``` | |
2. 也可以粘贴jsfiddle地址,比如: | |
http://jsfiddle.net/jikeytang/Rmt8M/ | |
评论支持markdown语法。 |
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. 如何居中一个浮动元素? | |
2. 如何使一个position:fixed的元素居于定宽居中div的右侧, | |
且随着窗口大小变化而位置不变? | |
3. 如何居中一个psoition:absolute元素? | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```html | |
// you code | |
``` |
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
用html,css实现以下三种情况的布局: | |
1. 2列布局:左固定,右自适应。 | |
2. 3列布局:左右固定,中自适应。 | |
3. 2行上下布局,下是左右布局: | |
a. 头部高固定且位置固定, | |
b. 下左宽度固定,下右宽度自适应且实现iframe高度自适应, | |
c. 全屏无横向滚动条,下左,下右内容超出高度时出现纵向滚动条 (可以不考虑ie6,用纯css实现)。 | |
PS: | |
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. 如何使容器透明,内容不透明? | |
分别用1个div或2个div的2种方式实现这个效果。 | |
2. style, !important, id, class, 标签, *(通配符)他们的权重顺序是怎么样的? | |
3. link 与 @import 的区别? | |
4. position: relative、absolute、fixed、static、inherit的区别? | |
5. display: inline,block,inline-block,list-item,inline-table,table-cell的区别? | |
PS: | |
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. body 与 .body | |
2. .main .sub 与 (.main, .sub) | |
3. .main > .sub 与 .main .sub | |
4. .main + .sub 与 .main .sub | |
5. .main + .sub 与 .main > .sub | |
6. [abc^="def"] 与 [abc$="def"] 与 [abc*="def"] 与 [abc^="def"] 与 [abc|="def"] 与 [abc~="def"] | |
7. p:first-child 与 ::first-line | |
8. * 与 (.main *) | |
9. :nth-child 与 :nth-last-child 与 :nth-of-type 与 :last-child 与 :first-of-type 与 :empty |
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
用正则怎样去除重复的字符串,只保留未重复的。 | |
如:var str= "aaabbbcccddde"; | |
结果为 abcde。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |