0.0.3
A set of tools based on jQuery
Repository
Current version released
5 years ago
Versions
jquery-utilities
A set of tools based on jQuery
istanbul (nyc) coverage report
| Statements | Branches | Functions | Lines |
|---|---|---|---|
Installation
npm install @uak2020/jquery-utilities
Usage
var { JqAjaxManager, UserInteraction, JsHelper } = require('@uak2020/jquery-utilities');
var userInteraction = new UserInteraction();
var jsHelper = new JsHelper();
var ajaxMgr = new JqAjaxManager();
ajaxMgr.userInteraction = userInteraction;
ajaxMgr.jsHelper = jsHelper;
ajaxMgr.performAjaxGet(
'http://localhost:5000/test',
{
successMessage: 'page loaded',
successCallback: function (result, url, textStatus) {
userInteraction.logit(result);
}
},
{
failureMessage: 'page load error',
failureCallback: function (textStatus, errorThrown) {
userInteraction.logerror(errorThrown);
}
}
);Points to note:
- successMessage and failureMessage can be omitted
- successMessage and failureMessage if provided as above, then browser alerts will be shown
- one must set “userInteraction” field/property of JqAjaxManager object as done above like:
ajaxMgr.userInteraction = userInteraction; - one must set “jsHelper” field/property of JqAjaxManager object as done above like:
ajaxMgr.jsHelper = jsHelper;
Tests
yarn test
Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.