Jquery中常用的AJax的方法有哪几个

Jquery中常用的AJax的方法有哪几个 


慕尼黑5688855
浏览 570回答 4
4回答

慕田峪7331174

第一种:$.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");}});

潇潇雨雨

$.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);  });

largeQ

(jquery.object).load()、$.get()、$.post、$.ajax()
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JQuery