br.getOpenLibraryRecord = function(callback) {
// Try looking up by ocaid first, then by source_record
- var jsonURL = this.olHost + '/query.json?type=/type/edition&*=&ocaid=' + br.bookId;
+ var self = this; // closure
+
+ var jsonURL = self.olHost + '/query.json?type=/type/edition&*=&ocaid=' + self.bookId;
$.ajax({
url: jsonURL,
success: function(data) {
if (data && data.length > 0) {
- callback(br, data[0]);
+ callback(self, data[0]);
} else {
// try sourceid
- jsonURL = this.olHost + '/query.json?type=/type/edition&*=&source_records=ia:' + br.bookId;
+ jsonURL = self.olHost + '/query.json?type=/type/edition&*=&source_records=ia:' + self.bookId;
$.ajax({
url: jsonURL,
success: function(data) {
if (data && data.length > 0) {
- callback(br, data[0]);
+ callback(self, data[0]);
}
},
dataType: 'jsonp'
// manually update with Launchpad version number at each checkin so that browsers
// do not use old cached version
// see https://bugs.launchpad.net/gnubook/+bug/330748
- $version = "3.0.1";
+ $version = "3.0.2";
if (BookReader::getDevHost($server)) {
// On dev host - add time to force reload