Drupal.behaviors.roblib_search_cufts = { attach: function(context, settings) { url = settings.roblib_search_cufts.search_url; jQuery.getJSON(url, function(data) { var items = []; var numberOfDocs = 0; try { numberOfDocs = data.journals.length; } catch (err) { // do nothing leave docLength at 0 } if (numberOfDocs < 1) { jQuery('#' + 'roblib-search-content-cufts').empty().append('No Results'); jQuery('.' + 'pane-roblib-search-cufts-roblib-search-cufts-results').hide(); } else { var counter = 0; var divs = new Array(); var content = new Array(); jQuery.each(data.journals, function(key, val) { id = 'roblib_cufts_results_' + counter; content[counter] = ""; divs[counter] = id; var item_str = '
no result
'); jQuery('#' + 'roblib-search-cufts-more').empty(); } }); } }