js常见题目

1、用正则表达式实现字符串首尾空格删除功能。

<script>

var string="abcdef";

str=str.replace(^s*|s*$,");

alert("str");

</script>

 

2、写一个hack样式实现在IE6、IE7、firefox下分别使用不同的颜色。

background:blue;

*background:red !important;

_background:yellow;

 

3、列出4个http状态码并解释含义。

200:OK;

400:bad request;

403:forbidden;

404:not found;

 

4、列出3个content-type

text/html

text/xml

image/fax

image/gif

 

posted on 2015-10-01 09:50  Bigmario  阅读(165)  评论(0编辑  收藏  举报