(I must confess, this question may show my lack of knowledge)
I have a basic webpage that consists of a button and a label. My goal is to trigger a REST call to a different domain when the button is clicked (cross-domain, I am aware) and then display the resulting HTML in the label.
In the past, I've experimented with APIs using JSON/P and dynamically adding elements, but this specific API does not support JSON. Therefore, I'm uncertain about how to proceed successfully.
The current code I am working with is:
function getESVData() {
$.get('http://www.esvapi.org/v2/rest/passageQuery?key=IP&passage=John+1', function (data) {
$('#bibleText').html(data);
app.showNotification("Note:", "Load performed.");
});
}
However, I receive an "Access denied" error. Is there a way to make this call successfully without relying on JSON?