在使用开发app ,中的资源差量更新的时候:
var dtask = plus.downloader.createDownload( message, {method:"GET"}, function(d,status){
if ( status == 200 ) {
console.log( "Download wgtu success: " + d.filename );
plus.runtime.install(d.filename,{},function(){
// plus.nativeUI.closeWaiting();
plus.nativeUI.alert("Update wgtu success, restart now!",function(){
plus.runtime.restart();
});
},function(e){
//plus.nativeUI.closeWaiting();
alert("Update wgtu failed: "+e.message);
});
} else {
// plus.nativeUI.closeWaiting();
alert( "Download wgtu failed: " + status );
}
} );
dtask.addEventListener('statechanged',function(d,status){
console.log("statechanged: "+d.state);
});
dtask.start();
有时候会出现如下的错误,然后不再执行后面的js代码
Cannot read property 'downloader' of undefined
请问该怎么解决呢????
0 个回复