标签:func fail fun ISE utils result log promise null
var promise = new Promise( function( resolve, reject ){
function onServiceSuccess( data ){
resolve( data )
}
function onServiceFail( data ){
reject( data ) ;
}
tempLoadUtils.loadURL(url, "GET", null, 10000, 3, onServiceSuccess, onServiceFail );
}) ;
var a;
promise.then(function(result) {
console.log(result); // “完美!”
}, function(err) {
console.log(err); // Error: "出问题了"
});
}
es6 中的 Promise
标签:func fail fun ISE utils result log promise null
原文地址:https://www.cnblogs.com/jason-beijing/p/10327892.html