Lv99Zubat
Lv99Zubat

Reputation: 853

what is ajaxOptions?

I found this in some javaScript code:

ajaxOptions = {
    data: {},
    success: function(data){
       $('#revenue_paginator').html(data);
    },
    error: function(){},
    complete: function(xhr){ 
        onCompleteCheck(xhr);
        }
    };

I just want know what it is. I originally thought it was jquery but there is nothing inside the jquery documentation about it. Google searches direct me to questions that involve ajaxOptions but nothing as simple as what ajaxOptions is.

Upvotes: 1

Views: 1852

Answers (3)

Explosion Pills
Explosion Pills

Reputation: 191779

ajaxOptions just looks like a normal variable name to me. You could do the following:

ajaxOptions = ...
$.ajax(ajaxOptions);

Upvotes: 1

Selvakumar Arumugam
Selvakumar Arumugam

Reputation: 79830

ajaxOptions that you have is just an javascript object defining different configuration parameters that can be passed to $.ajax jQuery function.

Upvotes: 1

Quintin Robinson
Quintin Robinson

Reputation: 82355

ajaxOptions is an arbitrary name assigned by the developer, the important part is what is in the object and how it relates to jQuery, you can review the jQuery documentations for ajaxSetup() to get a better understanding.

Description: Set default values for future Ajax requests.
version added: 1.1 jQuery.ajaxSetup( options )
options: A set of key/value pairs that configure the default Ajax request. All options are optional.

Upvotes: 3

Related Questions