I am trying to post a json to a restful web service from html file and it is showing "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource"
Code Sniplet from html ajax function:
var serviceurl="http://192.168.0.100:8080/login";
var data = {'emailId':'foo','password':'dog'};
$.ajax({
url: serviceurl,
type: 'GET',
contentType:'application/json',
data: JSON.stringify(data),
dataType:'json',
crossDomain: true,
xhrFields: {
withCredentials: true
},
success: function(data){
//On ajax success do this
alert(data);
}});