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 tagvalue = $("<p>" + file.name + "," + file.lastModifiedDate + "," + file.type + "," + file.size + "</p>").appendTo('#results');
console.log('tagvalue is ' + tagvalue);
tagvalue.appendTo("#results");
console.log('tagvalue is upended ' + tagvalue);
var r = $('<input type="button" value="upload" id="upload" / >');
console.log('button created!' + r);
r.appendTo("#results");
console.log('button uploded!' + r);
this.done = false;
} else {
this.done = true;
}
if (!this.done) {
this.continue();
}
}
$('#upload').on('click', function () {
console.log('onclick function!');
//alert('blah');
});
}
here I have created upload button dynamically and I have applied onclick
event
I want that after clicking on upload button user is able to upload audio file on server .if I will apply onclick
event on normal button is is working but with dynamic creation of button it is not working. Can any one help me plzz??