CyberStore Documentation
MakeAJAXCall Method
The name of the web service operation to be used.
A JavaScript object that contains the parameters and values to pass to the functionName.
The function to execute along with any returned data from the operation upon completion of the call.
A JavaScript object that contains any additional parameters to be sent to the successFunction.
Performs AJAX calls to the CyberStore GetData web service.
Syntax
var value; // Type: any
value = MakeAJAXCall(functionName,
                     passedParameters,
                     successFunction,
                     successFunctionParameters);
function MakeAJAXCall( 
   functionName : any,
   passedParameters : any,
   successFunction : any,
   successFunctionParameters : any
) : any;

Parameters

functionName
The name of the web service operation to be used.
passedParameters
A JavaScript object that contains the parameters and values to pass to the functionName.
successFunction
The function to execute along with any returned data from the operation upon completion of the call.
successFunctionParameters
A JavaScript object that contains any additional parameters to be sent to the successFunction.

Return Value

.
Example
// the Item_ID of an Item
var item_ID = 579;    

// Build object with parameters to send
var params = { 
    Item_ID: item_ID, 
    EnableOnHandQuantityDisplay: true, 
    EnableLeadTimeMessage: false, 
    LimitedAvailableMessage: 'Hurry only [qty] available.', 
    LimitedUnavailableMessage: 'Out of stock', 
    UnlimitedAvailableMessage: '[qty] In Stock', 
    UnlimitedUnavailableMessage: 'On Backorder', 
    LeadTimeMessage: ''
};

//
// Use AJAX to send a web service call to ~/util/GetData.asmx/GetData 
// passing results returned to the function logResults
//
MakeAJAXCall('GetOnHandQuantityDisplayString', params, logResults); 

function logResults(DATA) {
    console.log(DATA);    // '1256 In Stock'
}
Remarks

Use MakeAJAXCall to initiate client-side calls to the CyberStore web service operations. Include in the functionName parameter the name of the Services class in the format of "ServiceClass.MethodName" (e.g. "Price.GetDefaultPrice").

The following are available ServiceClass values:

Sending a value without a ServiceClass portion of the  of a functionName will post the call to the /ecommerce/util/GetData service by default.

To determine what current operations exist and therefore the values of the MethodName value, please visit the documentation for each web service from the list below: