Created
March 17, 2016 16:34
-
-
Save michaelschofield/0c9c1b229c1ce0c6909f to your computer and use it in GitHub Desktop.
ASU Library's WebPAC map() function
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 map(loclink, loc) { | |
var url = "/screens/map.html?loc=" + encodeURIComponent(loc); // add location code as url parameter | |
var $nextTD = $(loclink).closest('td').next(); // get the TD that contains the call number which is the next TD after the one that contains the clicked link | |
var call_num = $nextTD.text(); // get just the text of the call number TD (remove comments and html tags) | |
call_num = call_num.trim(); // trim to remove any preceding or trailing spaces from the call number | |
url += "&callnum=" + encodeURIComponent(call_num); // add call number as url parameter | |
window.open(url); // load url in new window | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment