

$.ajax 技巧:
$.ajax({
url: 'index.php?route=sale/order/history&token=<?php echo $token; ?>&order_id=<?php echo $order_id; ?>',
type: 'post',
dataType: 'html',
data: 'order_status_id=' + encodeURIComponent($('select[name='order_status_id']').val()) + '¬ify=' + encodeURIComponent($('input[name='notify']').attr('checked') ? 1 : 0) + '&append=' + encodeURIComponent($('input[name='append']').attr('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('textarea[name='comment']').val()),
beforeSend: function() {
$('.success, .warning').remove();
$('#button-history').attr('disabled', true);
$('#history').prepend('<div class"attention"><img src="view/image/loading.gif" alt="" /> <?php echo $text_wait; ?></div>');
},
complete: function() {
$('#button-history').attr('disabled', false);
$('.attention').remove();
},
success: function(html) {
$('#history').html(html);
$('textarea[name='comment']').val('');
$('#order-status').html($('select[name='order_status_id'] option:selected').text());
}
});