A-A+

js遍历array.indexOf出现此页面上的脚本造成internt explorer运行减慢解决办法

2016年01月14日 前端设计 暂无评论 阅读 5 views 次

js程序员可能会碰到在利用 javascript遍历array.indexOf时出现了性能提供页面,下面我们给大家提供解决出现此页面上的脚本造成internt explorer运行减慢代码.

  1. var hostsIP = {};   
  2. Ext.each(_this.hosts,function(item){   
  3. hostsIP[item.ip]=item.ip;   
  4. });  
  5. Ext.each(txtHostsIP,function(ip){   
  6. if(!hostsIP.hasOwnProperty(ip)){   
  7. var host = {   
  8. isAppend : true,//新增的主机   
  9. isAgentOk : false,   
  10. ip : ip   
  11. };   
  12. _this.hosts.push(   
  13. Ext.apply(host,_this.MAPPING_FIELDS)   
  14. );   
  15. isAppend = true;   
  16. }else{   
  17. errors.push('IP['+ip+']已存在');   
  18. }   
  19. });  
标签:

给我留言