4 回答
TA贡献1828条经验 获得超13个赞
第一种:
$.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贡献1833条经验 获得超4个赞
$.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 关注
- 569 浏览
添加回答
举报