CopyPastor

Detecting plagiarism made easy.

Score: 0.7943800091743469; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-07-03
by ORBIT

Original Post

Original - Posted on 2016-04-12
by Paul Fitzgerald



            
Present in both answers; Present only in the new answer; Present only in the old answer;

> pass `Access-Control-Allow-Origin`
function afficheorga(a){ $.ajax({ url: "URLXXXXXXXXXXXXXX", type: 'GET', dataType: 'jsonp', cors: true , contentType:'application/json', secure: true, headers: { 'Access-Control-Allow-Origin': '*', }, beforeSend: function (xhr) { xhr.setRequestHeader ("Authorization", "Basic " + btoa("")); }, success: function (data){ console.log(data.organizations[0].name); var organisation = data.organizations[0].name; $("#company").text(organisation); } }) }
You could get around this by using `jsonp`. Change `dataType` to `jsonp` so your `GET` request to be as follows
function afficheorga(a){ $.ajax({ url: "https://cubber.zendesk.com/api/v2/users/"+a+"/organizations.json", type: 'GET', dataType: 'jsonp', cors: true , contentType:'application/json', secure: true, headers: { 'Access-Control-Allow-Origin': '*', }, beforeSend: function (xhr) { xhr.setRequestHeader ("Authorization", "Basic " + btoa("")); }, success: function (data){ console.log(data.organizations[0].name); var organisation = data.organizations[0].name; $("#company").text(organisation); } }) }

        
Present in both answers; Present only in the new answer; Present only in the old answer;