I Added the following two host entries to my host file:
127.0.0.1 na_api.com
127.0.0.1 na_upload.com
The 127.0.0.1 na_api.com
is used to retrieve some data from a database and return JSON, while the 127.0.0.1 na_upload.com
is a website that consumes the API.
Currently, I have the following Ajax call, to call the API and get some data. Here is the Ajax call:
this.ajaxRetrieve = function (url, data, onSuccessCallback) {
$.ajax({
url: url,
data: data,
type: 'GET',
crossDomain: true,
onsuccess: function (result) {
onSuccessCallback(result);
}
});
}
The above outputs the following error:
No 'Access-Control-Allow-Origin' header is present on the requested resource
How can I work around this, without the needs of a back-end server side code like .Net or something?