I want to call this WS http://www.webservicex.net/country.asmx?op=GetCountries
What is the best possible way to do it using jQuery
I want to call this WS http://www.webservicex.net/country.asmx?op=GetCountries
What is the best possible way to do it using jQuery
If you want to make Cross-Domain calls with jQuery you'll either have set-up a "proxy" file on your own server which fetches the remote contents and sends them to local jQuery or you need the webservice to support JSONP
You could do this using the ajax method (either POST or GET). Here i use GET as all remote (not on the same domain) requests should be specified as GET. I also provide a callback method to show the result as an alert.
$.ajax({
type: "GET",
url: "http://www.webservicex.net/country.asmx",
data: "op=GetCountries",
success: function(msg){
alert( "Result: " + msg );
}
});