Fixed File I/O

This commit is contained in:
Joe Bowser
2009-10-28 13:43:39 -07:00
parent 06c626a44f
commit 9ea0857456
4 changed files with 27 additions and 8 deletions
+6
View File
@@ -93,6 +93,11 @@
navigator.file.read('/sdcard/phonegap.txt', fail , fail);
}
function writeFile()
{
navigator.file.write('foo.txt', "This is a test of writing to a file", fail, fail);
}
function init(){
document.addEventListener("touchmove", preventBehavior, false);
setTimeout(deviceInfo, 1);
@@ -120,6 +125,7 @@
<a href="#" class="btn" onclick="vibrate();">Vibrate</a>
<a href="#" class="btn" onclick="show_pic();">Get a Picture</a>
<a href="#" class="btn" onclick="readFile();">Read from file</a>
<a href="#" class="btn" onclick="writeFile();">Write to File</a>
<div id="viewport" class="viewport">
<img style="width:60px;height:60px" id="test_img" src="" />
</div>