function listContents(storagename) {
alert("inside function");
//Clear up the list first
$('#results').html("");
var files = navigator.getDeviceStorage(storagename);
var cursor = files.enumerate();
cursor.onsuccess = function () {
//alert("Got something");
var file = this.result;
if (file != null) {
var imageElement = $('<img height="100" width="75">');
imageElement.attr('src', window.URL.createObjectURL(file));
var tagvalue= $("<p>" + file.name + "," + file.lastModifiedDate + "," + file.type + "," + file.size + "</p>").appendTo('#results');
imageElement.appendTo("#results");
this.done = false;
}
else {
this.done = true;
}
if (!this.done) {
this.continue();
}
}
}
imageElement.onclick = function() {
console.log('onclick function!');
//alert('blah');
}
I am retrieving audio file list from SDCard in Firefox OS. Now I want to upload this file to server so for that when I do onclick
on image element I am able to do any event so I am trying to display alert box but it is not working.