我想將我的$.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