My code is like
$.ajax({ cache: false, url: <Web Service URL>, data: "{}", type: 'GET', crossDomain: true, dataType: 'json', success: function() { alert("Success"); }, error: function() { alert('Failed!'); }, });
I am trying to access the REST API from the client side using jQuery, but it gives an error like XMLHttpRequest cannot load <Web Service URL>. Origin null is not allowed by Access-Control-Allow-Origin. XMLHttpRequest cannot load <Web Service URL>. Origin null is not allowed by Access-Control-Allow-Origin.
So can someone help me solve this error ??
source share