为什么包含ajax请求的函数调用会在追加之前触发?
$("#range").on("click", function(){
$("#control").empty().append(.....); //why does this get executed after?
var data = 'something';
some_function_with_ajax(data);
}
function some_function_with_ajax(data){
$.ajax({
url: '/url',
type: 'POST',
data: {data: data},
success: function(resp){
// seems the append actually happens here
}
});
}