New version using XMLHttpRequest directly