Use window.XMLHttpRequest instead of XMLHttpRequest.