I am trying to get plain HTML as response in the plugin jquery.form.js (http://malsup.com/jquery/form/), but I can't get it. So my code looks like that:
print "$('#filter_form').ajaxForm({
target:'#ajax1',
beforeSend: function() {
console.log('Image uploading started.');
img_status.fadeOut();
img_slider.width('0%');
img_percent_text.html('0%');
},
uploadProgress: function(event, position, total, percentComplete) {
console.log('Image upload update...');
img_slider.width(percentComplete + '%');
img_percent_text.html(percentComplete + '%')
},
complete: function(responseText, statusText, xhr) {
img_slider.width('100%');
img_percent_text.html('100%')
console.log('Image uploading finished!');
img_preview.fadeOut(800);
alert(responseText);
}
});";
print "});";
print '</script>';
And for some reason this is changing the target wrong, take a look at the code...
if (empty($_POST)) {
...... // I get this code as output
}
else{
print "this should be the output via ajax";
}
So the questions are:
How to get the plain HTML in the complete function (responseText returns object)
How to fix the post parameters that i'm sending through ajax ?