pula-common-util
v1.1.3
Published
a collection of lightweight common javasccript utilities I use for day to day development. feel free to use
Downloads
9
Maintainers
Readme
pula-common-util
A collection of lightweight common javasccript utility functions I use for day to day frontend development. feel free to use
Installation
npm install pula-common-util --save
Usage
include "/dist/util.js" this would create a global 'util_' object where you can access functions ex: util_.functionname();
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
History
- 1.0.1 xhrResuest is now fully featured
- 1.0.0 project started
Author
##documentation
####dom functions
- add class
util_.addClass( element, className );
element can be a dom element or an array of elements
- remove class
util_removeClass( element, className );
element can be a dom element or an array of elements
####parse functions
- convert px in css values to number
util_.cssToNumber( string );
####ajax
- promisified ajax request
util_.xhrRequest(params);
params : {
url: string,
method: string, \\'GET', 'POST', 'PUT', 'DELETE'
headers: object,
params: string || object, \\object will be converted to a uri encoded string
}