Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am new to javascript ,I am feeling problem in understand the code.Real problem i am facing is that what is this configuration is it a function a variable or json object ????? Any help will be greatly appreciated.
JavaScript
configuration = {
    on: {
        start: function (transactionid, arguments) {        
            statusElement.append("<li>YUI IO Ajax Request STARTED [transactionid = " + transactionid + " , response = no response]</li>");
            },

        success: function (transactionid, response, arguments) {        
            statusElement.append("<li>YUI IO Ajax Request SUCCESS [transactionid = " + transactionid + " , responseText = " + response.responseText + " response.status = " + response.status + "]</li>");
        },

        failure: function (transactionid, response, arguments) {        
            statusElement.append("<li>YUI IO Ajax Request FAILURE [transactionid = " + transactionid + " , responseText = " + response.responseText + " response.status = " + response.status + "]</li>");
        },

        complete: function (transactionid, response, arguments) {        
            statusElement.append("<li>YUI IO Ajax Request COMPLETED [transactionid = " + transactionid + " , responseText = " + response.responseText + "response.status = " + response.status + "]</li>");
        },

        end: function (transactionid, arguments) {        
            statusElement.append("<li>YUI IO Ajax Request END [transactionid = " + transactionid + " , response = no response]</li>");
        }
    }
    };
Posted
Updated 15-Feb-14 8:52am
v3

1 solution

This is a JavaScript object containing a property called on, which in turn contains properties which are functions.

To invoke one of the functions you would write it like this:
JavaScript
configuration.on.start(transactionId, arguments)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900