use more portable XMLHttpRequest code