Revision 70022b58
Added by koszko about 1 year ago
src/worldcat-org-fix/worldcat.js | ||
---|---|---|
20 | 20 |
|
21 | 21 |
// Generate a function which, when invoked, loads the catalog holdings starting at i (one-indexed) focused on loc |
22 | 22 |
function generateGoTo(i, set_loc) { |
23 |
return function () { |
|
23 |
return function (e) { |
|
24 |
e.preventDefault(); |
|
24 | 25 |
; // If this is a new search, "set_loc" won't be set; set it |
25 |
var xhr = new content.XMLHttpRequest(), loc = set_loc || encodeURIComponent(locInput.value);
|
|
26 |
var xhr = new XMLHttpRequest(), loc = set_loc || encodeURIComponent(locInput.value); |
|
26 | 27 |
xhr.onreadystatechange = function () { |
27 | 28 |
if (this.readyState === 4) { |
28 | 29 |
if (this.status === 200) { |
... | ... | |
42 | 43 |
xhr.open('GET', 'https://www.worldcat.org/wcpa/servlet/org.oclc.lac.ui.ajax.ServiceServlet?wcoclcnum=' + itemRef + '&start_holding=' |
43 | 44 |
+ i + '&serviceCommand=holdingsdata&loc=' + loc, true); |
44 | 45 |
xhr.send(); |
45 |
return false; // Make sure the browser doesn't try to submit any holding form |
|
46 | 46 |
}; |
47 | 47 |
} |
48 | 48 |
|
Also available in: Unified diff
update Worldcat fix