Есть ли способ установить заголовок ответа в ("Access-Control-Allow-Origin", "*") в запросе jQuery Ajax, так как я не уверен, как это сделать ... это мой код ниже. . Любые предложения будут оценены ..
var on_show_info = function() {
request_info = $.ajax({
url: search_metadata + current_doc_info.id,
type: 'GET',
async: true,
success: on_metadata,
error: on_metadata_error
});
};
var on_get_metadata= function(data, text_status, XMLHttpRequest) {
alert("data");
console.log(data);
var html = "";
var info = {};
html = html + "<table border ='0'>";
html= html + "<tr>";
html =html + "<td><span style='color:#8A8A8A'>Item Location:</span> " +(data.response.docs[0].itemLocation)+"</td></tr>";
html =html + "<tr><td><span style='color:#8A8A8A'>Cycle: </span>" +(data.response.docs[0].lifeCycle)+"</td></tr>";
html =html + "<tr><td><span style='color:#8A8A8A'>Revision: </span>" +(data.response.docs[0].revision)+"</td></tr>";
html =html + "<tr><td><span style='color:#8A8A8A'>Timestamp: </span>" +(data.response.docs[0].timestamp)+"</td></tr>";
html =html + "<tr><td><span style='color:#8A8A8A'>ID: </span>" +(data.response.docs[0].id)+"</td></tr>";
html =html + "<tr><td><span style='color:#8A8A8A'>Attachment: </span>" +(data.response.docs[0].hasAttachment)+"</td></tr>";
html =html + "<tr><td><span style='color:#8A8A8A'>Description: </span>" +(data.response.docs[0].description)+"</td></tr>";
html =html + "<tr><td><span style='color:#8A8A8A'>Change: </span>" +(data.response.docs[0].changeNumber)+"</td></tr>";
if(data.response.docs[0].distributionLevel==undefined)
{
html =html + "<tr><td><span style='color:#8A8A8A'>Level: </span>Data Not Available</td></tr>";
}
else
{
html =html + "<tr><td><span style='color:#8A8A8A'>Distribution Level: </span>" +(data.response.docs[0].distributionLevel)+"</td></tr>";
}
//html =html + "<tr><td><span style='color:#8A8A8A'>Renewal Due Date: </span>" +(data.response.docs[0].c_renewal_due_date)+"</td></tr>";
if(data.response.docs[0].asicBomSubdescriptor==undefined)
{
html =html + "<tr><td><span style='color:#8A8A8A'>descriptor: </span>Data Not Available</td></tr>";
}
else
{
html =html + "<tr><td><span style='color:#8A8A8A'>descriptor: </span>" +(data.response.docs[0].asicBomSubdescriptor)+"</td></tr>";
}
html =html + "<tr><td><span style='color:#8A8A8A'>LifeCycle: </span>" +(data.response.docs[0].lifeCycle)+"</td></tr>";
html =html + "</table>";
$('#popup-meta').removeClass('waiting');
$('#popup-meta .popup-content').html(html);
};
var on_get_metadata_error = function(XMLHttpRequest, text_status, error) {
alert("error");
$('#popup-meta').removeClass('waiting');
$('#popup-meta .popup-content').html('<span class="data-error">Unable to get meta data.</span>');
};