Cocos-js网络请求

使用var xhr = cc.loader.getXMLHttpRequest();发送请求xhr.open(“POST”, “http://XXXXXXXXX”); xhr.setRequestHeader(“Content-Type”,“application/x-www-form-urlencoded”); 在执行xhr.onreadystatechange = function () { xhr.send(“login=”+JSON.parse(data).key);}方法。报错 NS_ERROR_NOT_INITIALIZED这是什么原因啊?