4 回答

TA貢獻(xiàn)1828條經(jīng)驗(yàn) 獲得超13個(gè)贊
第一種:
$.ajax({
type: "POST",
url: "ShowProduct.aspx/GetDHList",
data: '{CategoryId:"' + CategoryId + '"}',
contentType: "application/json;charset=utf-8",
dataType: "json",
success: function (data) {
var item = eval(data.d);
var StrHtml = "";
for (var i in item) {}
}, async: false
});
第二種:
$(document).ready(function(){
$("#b01").click(function(){
htmlobj=$.ajax({url:"/jquery/test1.txt",async:false});
$("#myDiv").html(htmlobj.responseText);
});
});
第三種:
$.ajax({ url: "test.html", context: document.body, success: function(){
$(this).addClass("done");
}});

TA貢獻(xiàn)1833條經(jīng)驗(yàn) 獲得超4個(gè)贊
$.ajax({
url: "test.html",
cache: false,
success: function(html){
$("#results").append(html);
}
});$("#feeds").load("feeds.php", {limit: 25}, function(){
alert("The last 25 entries in the feed have been loaded");
});$.get("test.cgi", { name: "John", time: "2pm" },
function(data){
alert("Data Loaded: " + data);
});$.post("test.php", { name: "John", time: "2pm" },
function(data){
alert("Data Loaded: " + data);
});
- 4 回答
- 0 關(guān)注
- 615 瀏覽
添加回答
舉報(bào)