JQuery custom query object - should my implementation be ported to my markup?

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";
//etc...
$("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, ... , .

+5
1

1) , HTML5, , : -, API-/ , , -, volatile, (firebug, js) , .

2) ( ) jQuery . data() - , , . "" ( firebug/js , , ). , , : -1 - , jQuery , DOM -2-, PHP, "rel" "rev" - , jQuery, , .

3) , , .data() , , , . , getter/setters - .

+1

All Articles