I want to display the image right after uploading it. For this I added the function $('#imageInput').on('change', function())
in the .success()
function of ajax but it does not work. alert("good")
pops "good" but alert("better")
does not pop "better".
Any ideas how to achieve this?
JS:
function afterSuccess(data)
{
if(data.indexOf('error')<0)
{ alert ("good");
$('#imageInput').on('change', function() {
alert ("better");
readPath(this);
});
}
}