use XMLHttpRequest first