How to read a image file from the WWW directory phonegap (IOS)

Mofsempopewaf

New Member
Basicly I want to read/get an image file (jpg) from the /WWW/images/ directory in phonegap for IOS5/6but I can't access to them.It's seems to be a simple task but I can't do It, it's frustratingThis is programed into a virtual machine and is played from a simulator.this is my code. \[code\]function first(){ window.requestFileSystem(LocalFileSystem.PERSISTENT,0,gotFS,fail1);}function gotFS(fileSystem){ console.log("gotFS__"); fileSystem.root.getFile("images/faq.jpg",null,gotFileEntry,fail1);}function gotFileEntry(fileEntry){ console.log("gotFileEntry___"); fileEntry.file(gotFile,fail1);}function gotFile(file){ readDataUrl(file);}function readDataUrl(file){ console.log("readDataUrl___"); var reader = new Filereader(); reader.onloadend=function(evt){ console.log("read as data URL"); console.log("result:"+evt.target.result); } } reader.readAsDataURL(file);}function fail1(evt){ console.log(evt.target.error.code);}\[/code\]there is no error report. but nothing happenswhere is my mistake?please help Me.best regards
 
Back
Top