Hi,
You are using a REST Service
function myEvents() {
$('#btnLeague').on("click", function () {
var myApi = "UGBYDUJKNNYOJKTOGWRSFUMBWUPDZKZFCQDZNMLXFMSAQDYLBW";
$.ajax({
type: 'Post',
url: "http://www.xmlsoccer.com/FootballDataDemo.asmx/GetAllLeagues",
data: "{ApiKey:'" + myApi + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
alert("ok");
}, error: function () { alert("error"); }
});
});
I think you have provide the URL wrong just paste this code I think it will work
If it dose not work den please post the server code
Enjoy.