mgibbs189

{{gist file=”test.js” lang=”javascript”}}
<script>
(function($) {
$(document).on(‘facetwp-loaded’, function() {
var href = ‘http://www.ncbi.nlm.nih.gov/pmc/?term=(%22Environmental+Health+Perspectives%22%5BJournal%5D)’;
var uri_string = FWP.build_query_string();

if (” != uri_string) {
// http://stackoverflow.com/a/8649003/32881
var uri_obj = JSON.parse(‘{“‘ + decodeURI(uri_string).replace(/”/g, ‘\”‘).replace(/&/g, ‘”,”‘).replace(/=/g,'”:”‘) + ‘”}’);
$.each(uri_obj, function(idx, val) {
href += ‘+AND+’ + val;
});
}
$(‘.pubmed-link’).attr(‘href’, href);
});
})(jQuery);
</script>
{{/gist}}