Hy every body, i am a new people in here, so i am need all of your help, please..
i have the script ajax like this,
<script type="text/javascript">
jQ(document).ready(function() {
jQ().ajaxStart(function() {
jQ('#loading').show();
jQ('#result').hide();
}).ajaxStop(function() {
jQ('#loading').hide();
jQ('#result').fadeIn('slow');
});
jQ('#frm').submit(function() {
var formData = new FormData($(this)[0]);
jQ.ajax({
type: 'POST',
url: jQ(this).attr('action'),
data: jQ(this).serialize(),
success: function(data) {
jQ('#result').html(data);
}
})
return false;
});
})
</script>
That code is succes to upload the data to database except the file (image) whats should i do so the file image also uploaded to database?
i have try with this code,
$("form#data").submit(function(){
var formData = new FormData($(this)[0]);
$.ajax({
url: window.location.pathname,
type: 'POST',
data: formData,
async: false,
success: function (data) {
alert(data)
},
cache: false,
contentType: false,
processData: false
});
return false;
});
and both of data and file (Image) succes uploaded to database, but the animasi when uploaded to database is lost, what should i do so the data and file (image) inserted to database, but using animasi like my first code...
thanks, for your any help...