WelcomeTo
WelcomeTo

Reputation: 20571

Jquery. Crossdomain ajax. POST method

It is possible to send POST data from JQUery to server, located in another domain? Google says that it impossible (Jquery.ajax() can send data only through GET method, not POST), but may be in new versions of Jquery it become possible?

Upvotes: 1

Views: 4403

Answers (3)

Carlos
Carlos

Reputation: 490

You can use jQuery ajax call to do a post from a different domain if you set crossDomain option to true, by default is set to false.

Check http://api.jquery.com/jQuery.ajax/ for crossDomain option.

Upvotes: 1

Andreas Louv
Andreas Louv

Reputation: 47099

And to answer the question you cannot access cross domain sites throw AJAX.

The reason why you can throw GET method is that you create an script tag (jsonp).

see: http://ajax.sys-con.com/node/1410501

Upvotes: 1

Oleksandr Fentsyk
Oleksandr Fentsyk

Reputation: 5386

Something like this

$.ajax({
  type: "POST",
  url: "http://someurl.com/",
  dataType: "jsonp",
  success: function(data){

  }
});

Upvotes: -1

Related Questions