面试1

2017-03-29  本文已影响0人  emoipower

跨域

jsonp

jsonp的原理就是动态滴创建script标签,将script标签的src的url中传入要发给其他域服务器的数据,和接收服务器返回数据的函数名字

iframe 缺点不利于seo

基于iframe实现的跨域要求两个域具有aa.xx.com,bb.xx.com这种特点,也就是两个页面必须属于一个基础域

ES6中fetch

fetch语法糖

fetch('/test/content.json', { // url: fetch事实标准中可以通过Request相关api进行设置
    method: 'POST',
    mode: 'same-origin', // same-origin|no-cors(默认)|cors
    credentials: 'include', // omit(默认,不带cookie)|same-origin(同源带cookie)|include(总是带cookie)
    headers: { // headers: fetch事实标准中可以通过Header相关api进行设置
        'Content-Type': 'application/x-www-form-urlencoded' // default: 'application/json'
    },
    body: 'a=1&b=2' // body: fetch事实标准中可以通过Body相关api进行设置
}).then(function(res){ res: fetch事实标准中可以通过Response相关api进行设置
    return res.json();
}).then(function(data){
    console.log(data);
}).catch(function(error){
    
});

字符串截取

angular双向绑定

angular与vue的区别

- CMD VS AMD

display的全部属性

img为行内替换元素 所以可以设置宽高

input框disabled之后如何获取value值

找Bug 用过firebug或者开发人员工具F12

如何解决移动端页面抖动

-webkit-backface-visibility: hidden  页面抖动

Less 特点

Less原理

gulp作用

上一篇 下一篇

猜你喜欢

热点阅读