如果数据作为对象提供,则使用POST方法;否则,假设GET.“
var car = {{ car }}
var motorcycle = {{ motorcycle }}
$('.send_data').on('click', function(e){
e.preventDefault();
$('#'+container).load(
$(this).attr('href'),
{ car: car, motorcycle: motorcycle },
function(data) {
$('#'+container).effect('highlight');
}
);
})
解决方法:
} else if ( params && typeof params === "object" ) {
type = "POST";
}
除非汽车或摩托车是not being classified as objects,否则应该发出POST请求.