Now that the proxied OpenLibrary requests are working, teach
result_common.js to use them and get an advantage from being an
access-rights-authenticated IP address (if applicable).
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
my( $self, $key ) = @_;
my $url = $read_api . $key;
+ $logger->debug("proxy_json with key '$key', url $url");
+
$self->send_json($AC->get_url($url)->content());
}
isbns += 'isbn:' + isbn + '|';
});
isbns = isbns.replace(/.$/, '');
- dojo.require('dojo.io.script');
- dojo.io.script.get({
- "url":"http://openlibrary.org/api/volumes/brief/json/" + isbns + '?callback=renderOpenLibraryLinks',
- "callback": "renderOpenLibraryLinks"
- });
}
+
+ dojo.xhrGet({
+ "url": "/opac/extras/ac/proxy/json/" + isbns,
+ "handleAs": "json",
+ "load": function (data) { renderOpenLibraryLinks(data); }
+ });
+
}
function renderOpenLibraryLinks(response) {