simple dom/event/ajax/selector syntactic sugar and basic ui framework(ie9+ or maybe no ie).
the target is creating very small($.js
only 1.2k compressed and not gzipped) and basic modules to be used in webpack/global. for simple pages, load the script/css into html to reduce http requests.
- selector(
$(selector)
) - event
Node.on(type, callback)
Node.off(type, callback)
- ajax
//all return Promise(xhr)
$.ajax(options)
/*
{
url: String
,data: Object
}
*/
$.get(url)
$.post(url, data)
- classHandling
$(selector).addClass
$(selector).removeClass
$(selector).hasClass
git clone https://github.com/zxdong262/simple-modules.git
cd simple-modules
npm install
npm run dev