i am unable to consuming web service using jquery ajax but it is possible using C# language. This is my jquery Ajax code`
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="jquery-3.0.0.js"></script>
<script>
$(document).ready(function(){
var url = "http://192.xxxx.xx.xx:10000/service1.asmx/GetJsonData";
$.ajax({
type: "GET",
url: url,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
alert("hii");
alert(data.d)
},
error: function (xmlHttpRequest, textStatus, errorThrown) {
alert("error");
}
});
})
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
The above code is not working but when i am trying the same using C# language it is working fine.
Error is:Network error:the Acess is denied in IE browser.
And the Error In Google Chrome is like following. XMLHttpRequest cannot load http://192.xxxx.xx.xx:10000/service1.asmx/GetJsonData.No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:49951' is therefore not allowed access.
`