A-A+
js遍历array.indexOf出现此页面上的脚本造成internt explorer运行减慢解决办法
js程序员可能会碰到在利用 javascript遍历array.indexOf时出现了性能提供页面,下面我们给大家提供解决出现此页面上的脚本造成internt explorer运行减慢代码.
- var hostsIP = {};
- Ext.each(_this.hosts,function(item){
- hostsIP[item.ip]=item.ip;
- });
- Ext.each(txtHostsIP,function(ip){
- if(!hostsIP.hasOwnProperty(ip)){
- var host = {
- isAppend : true,//新增的主机
- isAgentOk : false,
- ip : ip
- };
- _this.hosts.push(
- Ext.apply(host,_this.MAPPING_FIELDS)
- );
- isAppend = true;
- }else{
- errors.push('IP['+ip+']已存在');
- }
- });