Created
May 13, 2011 12:28
-
-
Save anonymous/970440 to your computer and use it in GitHub Desktop.
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
jQuery(document).ready(function($) { | |
var ezProxyBase = 'http://ezproxy.sussex.ac.uk/login?qurl='; | |
if (location.href.search(/\/items\//)!= -1 ) | |
{ | |
$("#mainResourceDetails tr#doi td span.fieldValue a").each(function() { | |
var doiLink = $(this).attr("href").replace(/\/link\?url=/,''); // get the uri encoded doi link - this will be the url param of the actual link, so chop off that bit. | |
var newLink = ezProxyBase + doiLink; // create the new location by prepending the ezProxyBase | |
$(this).attr("href","/link?url="+encodeURIComponent(newLink)); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment