PrizmDoc® Viewer v14.0 Release - Updated
PrizmDoc Viewer / API Reference / Viewer Control / Namespace: PCCViewer / Class: AjaxResponse
In This Topic
    Class: AjaxResponse
    In This Topic

    PCCViewer. AjaxResponse

    new AjaxResponse(response)

    This object provides a public API for AJAX Responses. It should be instantiated with every new AJAX response inside of Viewer Control.

    Parameters:

    Name Type Description
    response Object
    Properties
    Name Type Description
    headers Object
    status Number
    statusText String
    responseText String

    Properties:

    Name Description
    status : Number
    statusText : String
    responseText : String

    Methods

    getResponseHeader(header) → {String}

    Gets the value of a header

    Example

    // Get the header with a case-insensitive argument
    var response = new PCCViewer.AjaxResponse({
        headers: { 'Content-Type': 'application/json', 'X-Powered-By': 'Express' },
        status: 200,
        statusText: 'OK',
        responseText: 'Success!'
    });
    
    response.getResponseHeader('Content-Type'); // returns 'application/json'
    response.getResponseHeader('content-type'); // returns 'application/json'
    response.getResponseHeader('CONTENT-TYPE'); // returns 'application/json'
    
    

    Parameters:

    Name Type Description
    header String

    Returns:

    Type
    String

    Documentation generated by JSDoc 3.6.10 on Sun Feb 25 2024 19:35:19 GMT+0000 (Coordinated Universal Time)