Created
May 25, 2015 17:00
-
-
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.
This file contains hidden or 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() { | |
// 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> </span>'); | |
empty_span.insertAfter(el); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment