We have URL when we hit URL URL in browser we got data. We got Data like
[{"UserId":"c2fbd9fb-a423-4d33-9ea4-3aa58f7b52cf","UserType":"Parent","OutPutMessage":"Sucess"}].
But We need get data through ajax call.we tried like this
window.onload = function (){
$.ajax({
url:'http://janasenanews.com/MyService.asmx/GetUserLoginVerification',
data: {
username:"9440325333",
password :"9440325333"
},
type: "GET",
dataType: 'JSON',
success:function(data) {
alert( data);
//console.log("Here is the data", data);
}
});
}
But We got two error
Failed to load resource: the server responded with a status of 500 (Internal Server
XMLHttpRequest cannot load Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 500.
Please guide to us what wrong in our code.