I am trying to send a json object to a servlet .
but it is showing error like this: XMLHttpRequest cannot load http: //192.168.10.113:8080/collective-intellegence/SaveFeedback. Origin http: //192.168.9.185 is not allowed by Access-Control-Allow-Origin
My Code
var feedbackData = [];
for (j in storeData.collection) {
var fromData="abc";
feedbackData.push({
"queryid": queryId,
"from": fromData,
"to": GetUserDetails(storeData.item(j)),
"isresolved": document.getElementById(("chk" + j)).checked
});
}
$.ajax({
type: 'POST',
url: saveDataURL,
data: "{ 'feedback': '" + feedbackData + "' }",
dataType: 'json',
success: function (data) {
alert('Success');
},
error: function () {
alert('Error');
}
});
This is showing ERROR
i Googled and found that we can't pass json object to a cross domain.
so i decided to create a jsonp object which i can pass to cross domain .
please help to solve the problem
thanks in advance