Q: I am working to integrate the annotations into our application but for some reason, I can’t seem to get annotations to save and load. And everytime I attempt to load I get an error: "Annotations could not be loaded from the server"
WebViewer performs basic AJAX requests, like the following (taken from WebViewer/lib/html5/BaseReaderControl.js):
$.ajax({
url: serverUrl,
cache: false,
success: function(data) {
if (!_.isNull(data) && !_.isUndefined(data)) {
callback(data);
} else {
callback(originalData);
}
},
error: function(jqXHR, textStatus, errorThrown) {
/*jshint unused:false */
console.warn("Annotations could not be loaded from the server.");
callback(originalData);
},
dataType: 'xml'
});
Fortunately, none of this code is WebViewer-specific. So to simplify your investigation, you can execute this code in a standalone web page (entirely outside of WebViewer).
Additionally, you should take a look at the returned values jqXHR, textStatus, and errorThrown --- they might contain useful information.