1.1.3 • Published 10 years ago

pula-common-util v1.1.3

Weekly downloads
4
License
ISC
Repository
github
Last release
10 years ago

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

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

  • 1.0.1 xhrResuest is now fully featured
  • 1.0.0 project started

Author

pulasthi@pulasthibandara.com

##documentation

####dom functions

1) add class

	util_.addClass( element, className );

element can be a dom element or an array of elements

2) remove class

	util_removeClass( element, className );
element can be a dom element or an array of elements

####parse functions

1) convert px in css values to number

	util_.cssToNumber( string );

####ajax

1) 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
	}
1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago