首页 > 其他分享 >uniapp安卓本地文件读取(html5+)

uniapp安卓本地文件读取(html5+)

时间:2023-02-21 17:45:51浏览次数:34  
标签:function uniapp console log 安卓 html5 file reader entry

plus.io.resolveLocalFileSystemURL(
                    "_www/static/caise.json",//static下路径
                        function(entry){ //获取文件对象  
                            console.log("entry:"+entry.fullPath);  
                            entry.file( function ( file ) {
                                  //console.log(file);  
                             var reader = new plus.io.FileReader();  
                                                        reader = new plus.io.FileReader();  
                                                        reader.onloadend = function ( e ) {  
                                                            console.log( "Read success" );  
                                                           // console.log( e.target.result );
                                                            console.log( JSON.parse(e.target.result ));
                                                        };  
                                                        reader.readAsText( entry.fullPath );  
                            }, function ( e ) {
                                //alert( e.message );
                            } );
                         }  
                    )

标签:function,uniapp,console,log,安卓,html5,file,reader,entry
From: https://www.cnblogs.com/jyc226/p/17141815.html

相关文章