I have this code:
$(".input_photo").click(function() {
$.post("ajax/imagefile.html", function(img){
complete: $(".bp_load").fadeIn(0).html(img);
});
});
Imagefile
is a simple HTML page that contains the form and input type file with ID imageform
.
And I have another code:
$('#photoimg').live('change', function(){
$("#imageform").ajaxForm({
target: '.preview'
}).submit();
});
I searched in the web, and I understand that live
is deprecated, and I have changed to on
, but it doesn't work. The input type file is changed, but the event doesn't triggered.