I am developing a front- clean up/organize my API calls/refactorend request / data management system so that I interact with my backend platform. I am extending jquery ajax api call to interact with it, and I am looking for some tips on where to insert api-specific implementation.
please keep in mind that this is a web application platform and I try to simplify the management of external components
The goal is to define a query definition from something like ...
var requestObj = new Object();
requestObj.callback = function(responseObj){deleteUserComplete(responseObj); };
requestObj[0] = new Object();
requestObj[0].module = "usermanager";
requestObj[0].context = "#someTable";
requestObj[0].action = "DELETE_USER";
requestObj[0].dataObj = new Object();
requestObj[0].dataObj.userId = $("#ui-tabs-4 .az-switch-panel-off input[name$=userId]").val();
For...
$("button.apiSubmit").apiManager('submitApi');
or
var options = {};
options.callback = someFunction;
options.context = "#someTable";
$("button.apiSubmit").apiManager('submitApi', options);
, ... factory ( , , ) , api (, , ..) .
()...
1) / api ?
2) ( , - ) class html5 (x- ... )?
EX: ... class="apiButton apiButton-module-MODULE_NAME apiButton-action-ACTION_NAME" - , ... htis.
3) - , api / ? , php, ... , .