CCBoot.js jsb_boot.js

cc.loader.loadTxt(“http://www.baidu.com”, function(err,data){
cc.log(err);
cc.log(data+“er”);
});

在jsb模式下 此方法一直报cocos2d: Get data from file(http://www.baidu.com) failed!。错误。
仔细一看,CCBoot.js 和 jsb_boot.js都有这个方法。
我用这种方式
var xhr = cc.loader.getXMLHttpRequest();
xhr.onreadystatechange = function ()
{
if (xhr.readyState == 4 && xhr.status == 200)
{
var response = xhr.responseText;
if(response)
{
cc.log(response);
}
}
};
xhr.open(“GET”, “http://www.baidu.com/”);//这里是要请求的网络地址
xhr.send();
成功访问到百度。
那么问题来了,jsb模式下,cc.loader.loadTxt设计的时候就设计这个方法不支持网络访问吗?
我看到CCBoot.js文件中这个方法的实现是我第二种成功访问到网络的实现。
loadTxt: function (url, cb) {
if (!cc._isNodeJs) {
var xhr = this.getXMLHttpRequest(),
errInfo = “load " + url + " failed!”;
xhr.open(“GET”, url, true);
if (/msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent)) {
// IE-specific logic here
xhr.setRequestHeader(“Accept-Charset”, “utf-8”);
xhr.onreadystatechange = function () {
if(xhr.readyState == 4)
xhr.status == 200 ? cb(null, xhr.responseText) : cb(errInfo);
};
} else {
if (xhr.overrideMimeType) xhr.overrideMimeType(“text/plain; charset=utf-8”);
xhr.onload = function () {
if(xhr.readyState == 4)
xhr.status == 200 ? cb(null, xhr.responseText) : cb(errInfo);
};
}
xhr.send(null);
} else {
var fs = require(“fs”);
fs.readFile(url, function (err, data) {
err ? cb(err) : cb(null, data.toString());
});
}
}

而jsb_boot.js下是这样实现的
loadTxt : function(url, cb){
cb(null, jsb.fileUtils.getStringFromFile(url));
},

最后我总结一下我的疑惑:

1.cc.loader.loadTxt这个方法 是引擎在jsb下本身就不支持网络访问,还是我这用的有问题?
2.我应该如何访问网络才是符合引擎的设计?是直接这样var xhr = cc.loader.getXMLHttpRequest();吗?