I'm developing a SharePoint2013 application in which I can only use Client Scripts (such as JQuery). I have to show list of JIRA issues assigned to the current logged on user. The app is deployed to a different hos than SharePoint so, I need to make a cross domain script call (JSONP). I have tried a lot of different things including the one below and non of them has worked. Please let me know what should I do to make this call?
BTW, I have tried the parameters used for $.ajax({}) in curl and it's returning expected response. it's just the usage of jsonp (perhaps) that is not right in my code (below):
Thanks in advance
$(
'#ajax').click(function () {
$.ajax({
type:
"GET",
"Content-Type": "application/json",
dataType:
"jsonp",
url:
"https://brcmdemo.atlassian.net/rest/api/2/issue/DEMO-1",
success:
function (data) {
alert(
"hello there!");
alert(data)
},
error:
function () {
alert(
'failed');
},
beforeSend:
function (xhr) {
xhr.setRequestHeader(
"Authorization", "Basic a2F0aWVqOnBhc3NAd29yZDE=");
}
});
});
});