function successCallback(headers, response) {
    show_loading(false);

    // Write results to page
    document.getElementById("searchResults").innerHTML = response;
    var data = JSON.parse(response);
    var resultHtml = parseSolrResults(data);
    var elementId = SOLR_CONFIG["resultsElementId"];
    document.getElementById(elementId).innerHTML = resultHtml;

    // Add links to additional search result pages if necessary
    var currentStart = getParameterByName("start");
    if (!currentStart) {
        currentStart = 0;
    }
    else {
        currentStart = parseInt(currentStart);
    }
    var count = parseInt(data["response"]["numFound"]);
    var limit = parseInt(SOLR_CONFIG["limit"]);
    var showPages = parseInt(SOLR_CONFIG["showPages"]);
    var pageElementId = SOLR_CONFIG["pagesElementId"];
    showPageLinks(count, limit, showPages, currentStart, pageElementId);
    var query = getParameterByName("q");
    if (query) query = query.trim();
    var coreArea = getParameterByName("coreArea");
    if (coreArea && coreArea !== "any") {
        if (!(query && query.trim())) {
            query = coreArea + " core area"
        }
        else {
            query += " in " + coreArea + " core area";
        }
    }    
    showResultCount(query, count, limit, currentStart, SOLR_CONFIG["countElementId"]);
}
// Function to call if CORS request is successful
Function to call if CORS request is successful
Function to call if CORS request is successful
function successCallback(headers, response) {
    show_loading(false);
    document.getElementById("searchResults").innerHTML = response;
    var data = JSON.parse(response);
    var resultHtml = parseSolrResults(data);
    var elementId = SOLR_CONFIG["resultsElementId"];
    document.getElementById(elementId).innerHTML = resultHtml;
    var currentStart = getParameterByName("start");
    if (!currentStart) {
        currentStart = 0;
    }
    else {
        currentStart = parseInt(currentStart);
    }
    var count = parseInt(data["response"]["numFound"]);
    var limit = parseInt(SOLR_CONFIG["limit"]);
    var showPages = parseInt(SOLR_CONFIG["showPages"]);
    var pageElementId = SOLR_CONFIG["pagesElementId"];
    showPageLinks(count, limit, showPages, currentStart, pageElementId);
    var query = getParameterByName("q");
    if (query) query = query.trim();
    var coreArea = getParameterByName("coreArea");
    if (coreArea && coreArea !== "any") {
        if (!(query && query.trim())) {
            query = coreArea + " core area"
        }
        else {
            query += " in " + coreArea + " core area";
        }
    }    
    showResultCount(query, count, limit, currentStart, SOLR_CONFIG["countElementId"]);
}
function successCallback ( headers , response ) { show_loading ( false ) ; document . getElementById ( "searchResults" ) . innerHTML = response ; var data = JSON . parse ( response ) ; var resultHtml = parseSolrResults ( data ) ; var elementId = SOLR_CONFIG [ "resultsElementId" ] ; document . getElementById ( elementId ) . innerHTML = resultHtml ; var currentStart = getParameterByName ( "start" ) ; if ( ! currentStart ) { currentStart = 0 ; } else { currentStart = parseInt ( currentStart ) ; } var count = parseInt ( data [ "response" ] [ "numFound" ] ) ; var limit = parseInt ( SOLR_CONFIG [ "limit" ] ) ; var showPages = parseInt ( SOLR_CONFIG [ "showPages" ] ) ; var pageElementId = SOLR_CONFIG [ "pagesElementId" ] ; showPageLinks ( count , limit , showPages , currentStart , pageElementId ) ; var query = getParameterByName ( "q" ) ; if ( query ) query = query . trim ( ) ; var coreArea = getParameterByName ( "coreArea" ) ; if ( coreArea && coreArea !== "any" ) { if ( ! ( query && query . trim ( ) ) ) { query = coreArea + " core area" } else { query += " in " + coreArea + " core area" ; } } showResultCount ( query , count , limit , currentStart , SOLR_CONFIG [ "countElementId" ] ) ; }
Function to call if CORS request is successful
Function to call if CORS request is successful
// Write results to page // Add links to additional search result pages if necessary