Added promises, removed async false on xhr open call, RTFM and don't blindly copy others code