Created
June 8, 2015 16:32
-
-
Save jsicot/8a978e26197a63a5ee1a to your computer and use it in GitHub Desktop.
360.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get360link() { | |
if (!kioskMod && (jQuery("div.ISSN").size() > 0 || jQuery("div.ISBN").size() > 0)) { | |
if (jQuery("div.ISSN").size() > 0) { | |
var ISSN = jQuery("div.ISSN").text(); | |
var url = jsHost+OPAC_SVC+'360.php?request=issn&id='+ISSN; | |
} | |
else { | |
if (jQuery("div.ISBN").size() > 0) { | |
var ISBN = jQuery("div.ISBN").eq(index).text(); | |
var url =jsHost+OPAC_SVC+'360.php?request=isbn&id='+ISBN; | |
} | |
} | |
jQuery.ajax({ | |
url : url, | |
dataType: 'jsonp', | |
success : function(data, textStatus, jqXHR) { | |
if (data.length > 0) { | |
var container = jQuery("<div></div>").attr('id','360holdings'); | |
for (var i = 0 ; i < data.length ; i++) { | |
var toAppend = "<div class='360link'><a href='"+data[i].href+"' target='_blank'>"+data[i].title+"</a>"; | |
toAppend += (data[i].coverage != undefined)?" ("+data[i].coverage+")":""; | |
toAppend += "</div>"; | |
toAppend += (i < data.length-1)?"<hr/>":""; | |
container.append(toAppend); | |
} | |
jQuery('div#bibliodescriptions').first().append(container); | |
jQuery("#bibliodescriptions").tabs("add", "#360holdings", "<div class='360holdings'>Consulter en ligne</div>"); | |
} | |
}, | |
error : makeAjaxError | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment