Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

access control allow origin not allowed by

access control allow origin not allowed by  using -'javascript,ajax,xmlhttprequest,youtube-api'

I am seeing the following error:

Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin

with this code:

var http = new getXMLHttpRequestObject();
var url = "";
var sendXML = '<?xml version="1.0"?><entry xmlns=""'+
    '<media:group><media:title type="plain">My First API</media:title>'+
    '<media:description type="plain">First API</media:description>'+
    '<media:category scheme="">People</media:category>'+
    '<media:keywords>first, api</media:keywords></media:group></entry>';"POST", url, true);
http.setRequestHeader("Authorization", "AuthSub token=" + AccessToken);
http.setRequestHeader("X-GData-Key", "key="+ dev_key);
http.setRequestHeader("Content-Type", "application/atom+xml; charset=UTF-8");

http.onreadystatechange = function() {
    if(http.readyState == 4) {

What can cause this, and how do I solve it?

asked Oct 6, 2015 by rajnipancholi
0 votes

Related Hot Questions

Government Jobs Opening