Ajax

API

jQuery.get( [settings ] )

$.get( "ajax/test.html", function( data ) {
  $( ".result" ).html( data );
  alert( "Load was performed." );
});

jQuery.post( [settings ])

$.post( "ajax/test.html", function( data ) {
  $( ".result" ).html( data );
});

jQuery.getJSON(url [, data ] [, success ] )

url에 callback=?가 있으면 jsonp 동작

$.getJSON( "http://daum.net/?callback=?", function( data ) {
  var items = [];
  $.each( data, function( key, val ) {
    items.push( "<li id='" + key + "'>" + val + "</li>" );
  });

  $( "<ul/>", {
    "class": "my-new-list",
    html: items.join( "" )
  }).appendTo( "body" );
});

jQuery.ajax( url [, settings ] )

Low-Level Interface

$.ajax({
  method: "POST",
  url: "some.php",
  data: { name: "John", location: "Boston" }
})
  .done(function( msg ) {
    alert( "Data Saved: " + msg );
  });

results matching ""

    No results matching ""