我想将我的$.post
调用转换为$.ajax
调用,因为我需要清理每个调用的缓存。
我$.post
电话如下:
$.post("test",
function(data) {
$("#test").html(data);
initTest();
}
).success(function(){
$('.box1').hide("slide", {direction: "left"}, 1000);
$('.box3').show("slide", {direction: "right"}, 1000);
});
我试过,但它不工作...
$.ajax({
type: "POST",
url: "test",
success: function (data) {
$("#test").html(data);
$('.box1').hide("slide", {direction: "left"}, 1000);
$('.box3').show("slide", {direction: "right"}, 1000);
},
dataType: "json",
cache: false
});
您是否打算阅读[documentation](http://api.jquery.com/jQuery.post/)?这是它提到的第一件事。 – Jon 2012-04-25 11:20:06
是的..当然..但它不起作用 – newbie 2012-04-25 11:23:21
什么不工作?也许是因为url =“test”? – 2012-04-25 11:23:45