function addEventHandler(elem, eventType, handler) {
if (elem.addEventListener)
elem.addEventListener (eventType, handler, false);
else if (elem.attachEvent)
elem.attachEvent ('on' + eventType, handler);
}
var one = [{id: '1'}, {id: '2'}],
two = [{id: '2'}, {id: '5'}],
twoIds = [];
for ( i in two ) {
if ( two.hasOwnProperty(i) ) {
twoIds[two[i].id] = 1;
}
}
for (i in one) {
if ( one.hasOwnProperty(i) ) {
if ( twoIds[one[i].id] !== undefined ) {
one[i].field = true;
}
}
}
setInterval( function(){ window.location.reload() }, 100 );