Skip to content

Instantly share code, notes, and snippets.

@happyrainb
Created May 25, 2015 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save happyrainb/c1d2ededf3afab7e96ef to your computer and use it in GitHub Desktop.
Save happyrainb/c1d2ededf3afab7e96ef to your computer and use it in GitHub Desktop.
This Javascript file adds a license link to each of the e-resources in 360Link 2.0 user interface.
jQuery(document).ready(function() {
// get all the elements that have a class name '.resource-name'
var links = jQuery(".resource-name");
// go through the elements and add a link after each one based on the text each element contains
for(var i =0; i<links.length; i++){
// turn the current item into a jquery object
var el = jQuery(links[i]);
// create a new jquery object which is the new link
var new_link = jQuery('<a target="_blank" href="https://baseURL?name='+(urlencode($(this).text()))+'">[License of Use]</a>');
new_link.insertAfter(el);
var empty_span = jQuery('<span>&nbsp;</span>');
empty_span.insertAfter(el);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment