惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
雷峰网
雷峰网
GbyAI
GbyAI
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
V
V2EX
Jina AI
Jina AI
Apple Machine Learning Research
Apple Machine Learning Research
C
CXSECURITY Database RSS Feed - CXSecurity.com
美团技术团队
Engineering at Meta
Engineering at Meta
T
Tenable Blog
P
Privacy & Cybersecurity Law Blog
Project Zero
Project Zero
Cloudbric
Cloudbric
Help Net Security
Help Net Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LINUX DO - 热门话题
J
Java Code Geeks
WordPress大学
WordPress大学
S
Securelist
F
Full Disclosure
N
News and Events Feed by Topic
B
Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
InfoQ
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
U
Unit 42
Google Online Security Blog
Google Online Security Blog
Spread Privacy
Spread Privacy
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Schneier on Security
Schneier on Security
Google DeepMind News
Google DeepMind News
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
月光博客
月光博客
Martin Fowler
Martin Fowler
T
Threat Research - Cisco Blogs
小众软件
小众软件
V2EX - 技术
V2EX - 技术
Last Week in AI
Last Week in AI
Stack Overflow Blog
Stack Overflow Blog
The Last Watchdog
The Last Watchdog
D
DataBreaches.Net

博客园 - Ranran

ASP.NET 5与MVC 6中的新特性 .NET技术大系概览 (迄今为止最全的.NET技术栈) 7 天玩转 ASP.NET MVC — 第 1 天 11个Visual Studio代码性能分析工具 高效的使用 Response.Redirect CLR 这些年有啥变化吗? ASP.NET 大文件下载的实现思路及代码 7个Linux和Ubuntu下的免费CSS编辑器 11个很棒的 jQuery 图表库 javascript客户端检测技术 编写更好的C#代码 ASP.NET中gridview获取当前行的索引值 .NET逻辑分层架构总结 ASP.NET MVC 4 的JS/CSS打包压缩功能-------过滤文件 ASP.NET 生成二维码(采用ThoughtWorks.QRCode和QrCode.Net两种方式) ASP.NET中利用DataList实现图片无缝滚动 老码农教你在 StackOverflow 上谈笑风生 ASP.NET 生成二维码(采用ThoughtWorks.QRCode和QrCode.Net两种方式) Asp.net面试题
腾讯web前端笔试题及个人答案
Ranran · 2015-07-22 · via 博客园 - Ranran

每道题都有答案,大多数答案亲测正确。

简答题

1.js中“5”+4=?    

答案:54

2.js中void(0)=?    

答案:undefined

3.js中NaN*4=?    

答案:NaN

4.js中null*4.5=?   

答案:0

5.js中alert(5*015===5.075)      

答案:false,结果不一样。

6.js中13>>2=? -13>>2=?         

答案:3 ,-4 ,除以4,然后向下取整。

7.js中13|5=? 13&5=?                

答案:按位或:13,按位与:5。

8.js中怎么获取当前日期的月份        

答案:

  1. <span style="font-size:18px;">var date = new Date();   var mouth = date.getMonth();</span>  

9.js中数组排序方法是?该方法实现了什么的排序算法?   

答案:排序方法是sort(),实现了按字符排序的算法。
例var arr = [1,2,55,12,88];arr.sort();//ASCII字符代码从小到大排,arr结果为[1,12,2,55,88];

10.js中怎么判断chrome浏览器?      

答案:

  1. <span style="font-size:18px;">isChrome = window.navigator.userAgent.indexOf("Chrome") !== -1;
  2. 当isChrome=true时,为chrome浏览器</span>  

11.js中var b=”hello”;a=b; 怎么显示出a的值(貌似这题最简单了)   

 答案:

  1. <span style="font-size:18px;">document.write(a);</span>  


12.根据以下xml请写出对应的json

  1. <span style="font-size:18px;"><xml>  
  2. <list>  
  3. <item>  
  4. <id>12</id><name>张三</name>  
  5. </item>  
  6. <item><id>13</id><name>李四</name>  
  7. </item>  
  8. </list>  
  9. </xml></span>  

答案: 

  1. <span style="font-size:18px;">var lists = [{"id":"12","name":"张三"},{"id":"13","name":"李四"}];</span>  

13.js中怎么把十进制数123转化成二进制数?    

答案:

  1. <span style="font-size:18px;">123.toString(2);</span>  
  1. <span style="font-size:18px;"><script type=”text/javascript”>  
  2.   
  3. document.onkeydown = function(event){  
  4. event = event?event:window.event;  
  5. if (event.keyCode == 13) {  
  6. alert(“hello world!”);  
  7. }  
  8. };  
  9. </script></span>  

编程题

1.js中var s=”tencent is sb”,编写js使其变成tencent1 is2 sb3

  1. <span style="font-size:18px;"><script type="text/javascript">  
  2.     var s = "tencent is perfect";  
  3.     var array = s.split(" ");  
  4.     s = "";  
  5.     for(var i=0; i < array.length; i ++){  
  6.         s += array[i] + (i+1) + " ";  
  7.     }  
  8.     document.write(s);  
  9. </script></span>  

2.编写js的类,使其拥有public和private类型的属性和方法

  1. <span style="font-size:18px;"><script type="text/javascript">  
  2. function Person(_name,_age,_sex,_salary){  
  3.     
  4.     this.name = _name;  
  5.     this.age = _age;  
  6.   
  7.     
  8.     var sex = _sex;  
  9.     var salary = _salary;  
  10.   
  11.     
  12.     this.getName = function(){  
  13.         return this.name;  
  14.     }  
  15.   
  16.     this.getAge = function(){  
  17.         return this.age;  
  18.     }  
  19.   
  20.     
  21.     function getSex(){  
  22.         return sex;  
  23.     }  
  24.   
  25.     function getSalary(){  
  26.         return salary;  
  27.     }  
  28.   
  29.     this.display = function(){  
  30.         document.write(this.getName() + "---" + this.getAge() + "---" + getSex() + "----" + getSalary());  
  31.     }  
  32.   
  33. }  
  34.   
  35. var smirk = new Person("zy","21","f","5000");  
  36. smirk.display();  
  37. </script></span>  

3.说出一些常用的网络优化工具

答:优化大师,超级兔子
SEO(Search Engine Optimization)缩写而来, 中文意译为“搜索引擎优化”。
SEO优化工具:
1.TrafficTravis——SEO分析工具
2.Backlinkwatch.com—反链检测
3.XENU Link Sleuth—死链检测
4.SEO Tool Bar (火狐插件)
5.SEO Quake (火狐插件)

面试官问的题


1.css的样式在不同类型的浏览器之间的显示差异如何解决
答:(个人理解)先判断为何种浏览器,再为不同浏览器加载不同的css
a. CSS中几种浏览器对不同关键字的支持,可进行浏览器兼容性重复定义 !important 可被FireFox和IE7识别 * 可被IE6、IE7识别 _ 可被IE6识别 *+ 可被IE7识别
b. 应用条件注释(只对IE有效),因为IE各版本的浏览器对我们制作的WEB标准的页面解释不一样,具体就是对CSS的解释不同,我们为了兼容这些,可运用条件注释来各自定义,最终达到兼容的目的。
比如:

  1. <span style="font-size:18px;"><!– 默认先调用css.css样式表 –>  
  2. <link rel="stylesheet" type="text/css" href="css.css" />  
  3. <!–[if IE 7]>  
  4. <!– 如果IE浏览器版是7,调用ie7.css样式表 –>  
  5. <link rel="stylesheet" type="text/css" href="ie7.css" />  
  6. <![endif]–>  
  7. <!–[if lte IE 6]>  
  8. <!– 如果IE浏览器版本小于等于6,调用ie.css样式表 –>  
  9. <link rel="stylesheet" type="text/css" href="ie.css" />  
  10. <![endif]–></span>  

2.在css中用一行css代码实现在不同类型的浏览器(如IE6,IE7,IE8)之间显示出不同的样式

  1. <span style="font-size:18px;">.mycolor{  
  2.     color:#FFF\9;
  3.     *color:#FF0;
  4.     _color:#F00;
  5. }</span>  

3.页面上有左中右三列,左右两列列宽固定,中间列自适应,要求纸上手写代码

    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    2. <html xmlns="http://www.w3.org/1999/xhtml">  
    3. <head>  
    4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
    5. <title>三栏布局-浮动方法</title>  
    6. <style type="text/css">  
    7.     body,div,p{   
    8.         margin:0;   
    9.         padding:0;   
    10.     }  
    11.   
    12.     #wrap {   
    13.         padding:0 300px 0 200px;   
    14.         *overflow:hidden;    
    15.     }  
    16.   
    17.     #main {   
    18.         float:left; width:100%;   
    19.         height:600px;  
    20.         background:#fffaba;  
    21.     }  
    22.   
    23.     #left, #right {   
    24.         position:relative;   
    25.         height:600px;  
    26.         _display:inline;   
    27.     }  
    28.   
    29.     #left {   
    30.         width:200px;   
    31.         float:left;   
    32.         margin-left:-100%;   
    33.         right:200px;   
    34.         _right:-300px;   
    35.         background:#8fc41f;  
    36.     }  
    37.   
    38.     #right {   
    39.         width:300px;   
    40.         float:right;   
    41.         margin-right:-300px;   
    42.         background:#00b7ef;  
    43.     }  
    44. </style>  
    45. </head>  
    46. <body>  
    47. <span style="white-space:pre">    </span><div id="wrap">  
    48.         <div id="main">  
    49.             main  
    50.         </div>  
    51.         <div id="left">  
    52.             left  
    53.         </div>  
    54.         <div id="right">  
    55.             right  
    56.         </div>  
    57.     </div>  
    58. </body>  
    59. </html>