您当前所在位置:
88好学网范文常识招聘应聘笔试腾讯web前端开发笔试题和答案» 正文

腾讯web前端开发笔试题和答案

[10-20 23:53:58]   来源:http://www.88haoxue.com  笔试   阅读:680

概要:5 请设计一套方案,用于确保页面中JS加载完全。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 var n = document.createElement("script"); n

腾讯web前端开发笔试题和答案,标签:笔试大全,http://www.88haoxue.com

  5 请设计一套方案,用于确保页面中JS加载完全。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

var n = document.createElement("script"); 

n.type = "text/javascript"; 

//以上省略部分代码 

//ie支持script的readystatechange属性 

if(ua.ie){ 

   n.onreadystatechange = function(){ 

       var rs = this.readyState; 

       if('loaded' === rs || 'complete'===rs){ 

           n.onreadystatechange = null; 

           f(id,url); //回调函数 

       } 

}; 

//省略部分代码 

//safari 3.x supports the load event for script nodes(DOM2) 

   n.addEventListener('load',function(){ 

       f(id,url); 

   }); 

//firefox and opera support onload(but not dom2 in ff) handlers for 

//script nodes. opera, but no ff, support the onload event for link 

//nodes. 

}else{ 

   n.onload = function(){ 

       f(id,url); 

   }; 

}

上一页  [1] [2] [3] [4] [5] [6] [7] [8]  下一页


Tag:笔试笔试大全招聘应聘 - 笔试

上一篇:华诺集团笔试题

》《腾讯web前端开发笔试题和答案》相关文章