日期:2014-05-16 浏览次数:20624 次
load(url, [data], [callback])
$("#feeds").load("feeds.php", {limit: 25}, function(){ alert("The last 25 entries in the feed have been loaded"); });
jQuery.get(url, [data], [callback], [type])
$.get("test.cgi", { name: "John", time: "2pm" }, function(data){ alert("Data Loaded: " + data); });
jQuery.ajax([options])
$.ajax({ type: "GET", url: "test.js", dataType: "script" });
$.ajax({ type: "POST", url: "some.php", data: "name=John&location=Boston", success: function(msg){ alert( "Data Saved: " + msg ); }, error:function (XMLHttpRequest, textStatus, errorThrown){ } });
jQuery.getJSON(url, [data], [callback])
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?", function(data){ $.each(data.items, function(i,item){ $("<img/>").attr("src", item.media.m).appendTo("#images"); if ( i == 3 ) return false; }); });