-1
$.ajax({
url: 'index.php?route=account/edit',
type: 'post',
data: $('#account_edit input[type=\'text\'], #account_edit input[type=\'password\'],**#account_edit input[type=\'file\']**,#account_edit input[type=\'radio\']:checked'),
dataType: 'json',
beforeSend: function() {
$('#button-update').attr('disabled', true);
$('#button-update').after('<span class="wait"> <img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#button-update').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
$('.warning').remove();
$('.error').remove();
//alert(json['error']['firstname']);
if (json['redirect']) {
//location = json['redirect'];
}
}
請添加一些問題描述。 – 2012-08-06 12:24:42
http://stackoverflow.com/questions/10492617/how-can-i-upload-a-file-using-jquerys-ajax-function-with-json-and-php?rq=1 – 2012-08-06 12:27:48