Skip to content

Commit 1c3b28b

Browse files
authored
README.md: Correct onwriteend to onwrite (#639)
- FileWriter.onwriteend will always be called, whether the write was successful or not - FileWrite.onwrite is the correct callback to listen on successful writes - Correct misspelling in console.log for onwrite and onerror
1 parent 92caa81 commit 1c3b28b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ function writeFile(fileEntry, dataObj) {
639639
// Create a FileWriter object for our FileEntry (log.txt).
640640
fileEntry.createWriter(function (fileWriter) {
641641
642-
fileWriter.onwriteend = function() {
642+
fileWriter.onwrite = function() {
643643
console.log("Successful file write...");
644644
readFile(fileEntry);
645645
};
@@ -703,13 +703,13 @@ function writeFile(fileEntry, dataObj, isAppend) {
703703
// Create a FileWriter object for our FileEntry (log.txt).
704704
fileEntry.createWriter(function (fileWriter) {
705705
706-
fileWriter.onwriteend = function() {
707-
console.log("Successful file read...");
706+
fileWriter.onwrite = function() {
707+
console.log("Successful file write...");
708708
readFile(fileEntry);
709709
};
710710
711711
fileWriter.onerror = function (e) {
712-
console.log("Failed file read: " + e.toString());
712+
console.log("Failed file write: " + e.toString());
713713
};
714714
715715
// If we are appending data to file, go to the end of the file.
@@ -783,7 +783,7 @@ function writeFile(fileEntry, dataObj, isAppend) {
783783
// Create a FileWriter object for our FileEntry (log.txt).
784784
fileEntry.createWriter(function (fileWriter) {
785785
786-
fileWriter.onwriteend = function() {
786+
fileWriter.onwrite = function() {
787787
console.log("Successful file write...");
788788
if (dataObj.type == "image/png") {
789789
readBinaryFile(fileEntry);

0 commit comments

Comments
 (0)