zoukankan      html  css  js  c++  java
  • 腾讯笔试题

    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中怎么获取当前日期的月份        答案:      var date = new Date();   var mouth = date.getMonth();

    9.js中数组排序方法是?该方法实现了什么的排序算法?    答案:排序方法是sort(),实现的是————

    10.js中怎么判断chrome浏览器?      答案:用户代理检测,用navigator.userAgent检测。

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

    12.根据以下xml请写出对应的json(原题写成一行,这里我改成标准xml的显示了

    <xml>
    
    <list>
    
    <item>
    
    <id>12</id>
    
    <name>张三</name>
    
    </item>
    
    <item>
    
    <id>13</id>
    
    <name>李四</name>
    
    </item>
    
    </list>
    
    </xml>

     答案: var lists = [{"id":"12","name":"张三"},{"id":"13","name":"李四"}];

     13.js中怎么把十进制数123转化成二进制数?    答案:123.toString(2);

    14.js中怎么才能按下回车键可以提交

    <script type=”text/javascript”>
    //按下回车登录系统
    document.onkeydown = function(event){
    event = event?event:window.event;
    if (event.keyCode == 13) {
    alert(“hello world!”);
    }
    };
    </script>

    编程题

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

             <script type="text/javascript">
                var s = "tencent is perfect";
                var array = s.split(" ");
                s = "";
                for(var i=0; i < array.length; i ++){
                    s += array[i] + (i+1) + " ";
                }
                document.write(s);
             </script>

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

             <script type="text/javascript">
                function Person(_name,_age,_sex,_salary){
                    //public
                    this.name = _name;
                    this.age = _age;
                    
                    //privare
                    var sex = _sex;
                    var salary = _salary;
                    
                    //public method
                    this.getName = function(){
                        return this.name;
                    }
                    
                    this.getAge = function(){
                        return this.age;
                    }
                    
                    //private methd
                    function getSex(){
                        return sex;
                    }
                    
                    function getSalary(){
                        return salary;
                    }
                    
                    
                    this.display = function(){
                        document.write(this.getName() + "---" + this.getAge() + "---" + getSex() + "----" + getSalary());
                    }
                
                }
                
                var smirk = new Person("zy","21","f","5000");
                smirk.display();
             </script>

    3.给定http://id.qq.com/125125,请说出请求报头,相关的报文信息(想想httpwatch工具抓包的内容)

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

    面试官问的题

    1.css的样式在不同类型的浏览器之间的显示差异如何解决

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

    3.页面上有左中右三列,左右两列列宽固定,中间列自适应,要求纸上手写代码(最傻眼的是这个了)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>三栏布局-浮动方法</title>
        <style type="text/css">
        body,div,p{ 
            margin:0; 
            padding:0; 
        }
    
        #wrap { 
            padding:0 300px 0 200px; 
            *overflow:hidden;  
        }
    
        #main { 
            float:left; width:100%; 
            height:600px;
            background:#fffaba;
        }
    
        #left, #right { 
            position:relative; 
            height:600px;
            _display:inline; 
        }
    
        #left { 
            width:200px; 
            float:left; 
            margin-left:-100%; 
            right:200px; 
            _right:-300px; 
            background:#8fc41f;
        }
    
        #right { 
            width:300px; 
            float:right; 
            margin-right:-300px; 
            background:#00b7ef;
        }
         </style>
      </head>
    <body>
        <div id="wrap">
             <div id="main">
                 main
             </div>
    
             <div id="left">
                 left
             </div>
             <div id="right">
                 right
             </div>
        </div>
    </body>
    </html>
  • 相关阅读:
    Shell 脚本学习 — 简单的执行跟踪
    CentOS — 安装Git客户端
    Linux — cat 命令的使用方法
    关于“分叉/联接方案”的一般做法
    读书笔记 —— 《MySQL技术内幕 InnoDB存储引擎》
    MySQL InnoDB 索引
    CentOS — MySQL备份 Shell 脚本
    CI system/libraries/Session.php
    WinForm 处理未处理的异常 Application.ThreadException + AppDomain.CurrentDomain.UnhandledException
    重构案例1 — ECShop (lib_common.php build_url 函数)
  • 原文地址:https://www.cnblogs.com/yingsmirk/p/2442185.html
Copyright © 2011-2022 走看看