i have used all the Ajax code but it gives some error like "XMLhttprequest can not load" after using the "access-control-allow-origin: '*'" in my java script code it gives some another error like "unexpected error" . i have searched on internet last 3-4 days but i am not getting any solution finally i am here guys please help me to solve this problem .
This is my code:`
jQuery.noConflict();
jQuery(document).ready(function( $ ){
var encryptedText = "hdEAo+i4qK9UmgYlbHE490RFcqq";
new Ajax.Request('http://example.com/json/service', {
access-control-allow-origin: '*',
method: 'post',
contentType: 'application/json',
postBody: '{"abc":{"request":'+encryptedText+'}}',
onSuccess: function(transport){
var myObject = eval('(' + transport.responseText + ')');
alert("success");
},
OnFailure : function(){
alert("fail");
},
});
});`
i have also used prototype.js in my project.
i don't have any idea about "access-control-allow-origin" code where i put in my code please tell me .
Please give me with coding not only theory guys because i am new in this field.
i will really appreciate all guys who solve this problem.