jQuery: Schnell mit Ajax Daten vom Server holen

Am einfachsten die Shorthands von jQuery verwenden:

Post

$.post("http://url.tld", { variable1: "wert1", 'array1[]': [ "Jon", "Susan" ] },'json')
.done(function(data){
      //Do Something
});

oder

$.post("http://url.tld",{ variable1: "wert1", 'array1[]': [ "Jon", "Susan" ] }, function (data){
   //Do Something
},'json')

Get

$.get("http://url.tld", { variable1: "wert1", 'array1[]': [ "Jon", "Susan" ] },'json')
.done(function(data){
      //Do Something
});

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top