vanilla-js

0.0.1 • Public • Published

Vanilla JS - fast, lightweight, cross-platform framework

jQuery-like Aliases (NOT Wrappers) to HTML5 Selector API / Raw Document

  • Cross-browser compatible*
    • *HTML5 Selector API is IE8+
    • *XMLHttpRequest is IE7+
    • *Element.prototype is IE8+
  • Forget chaining; its too expensive

Inspired by the classic parody vanilla-js.com.

Demonstration

# btw its XHR, not AJAX 
# in Node.js callback style 
$.xhr 'GET''http://coffeescript.org/robots.txt'''(err, data, status, xhr) ->
  return console.log errdatastatusxhrxhr.readyStatexhr.status if err
  console.log status
  console.log data
 
= $.liveTag('p')
pp = $.all('p')
console.log p.length
console.log pp.length
#console.log $.one('body').append($.create('p')) 
console.log $.create('p').appendTo($.one('body'))
console.log p.length # will be +1 
console.log pp.length # will be same as before 

View Source

Commented code is in ./coffee/

Helpful

Readme

Keywords

none

Package Sidebar

Install

npm i vanilla-js

Weekly Downloads

13

Version

0.0.1

License

MIT

Last publish

Collaborators

  • mikesmullin