Not a plugin, not a framework... Just a collection of common JavaScript methods for the client.
The scope of common.js is to persist on the rule "one include of the absolutely necessary" as a foundation to start building any dependency stack.
Includes common polyfills:
- Modernizr
- Universal console.log
- iOS orientationchange fix
- mqa.js
- Fastclick
- Base64.js
- CSS: background-video
Also contains a small toolkit of fundamental operations, mapped in the "c" variable on the global namespace.
Using bower:
bower install common.js
These methods are available in the window.c
namespace:
- query( str ) : Parses a query to a javascript object
- script( url ) : Adds a new script to the DOM
- cookie( val ) : Simplified CRUD for document.cookie
- extend({a}, {b}) : Merging two objects recursively
- link( url ) : Adds a new link tag, of an HTML import or a stylesheet
- scroll( options ) : Scroll monitoring for DOM updates - Example
- type( variable ) : Check the type of a variable
- visible( element ) : Minimal check if a DOM element is visible in the browser window
Initialized by Makis Tracend
Part of the Commons collection of web assets
Distributed by Makesites.org
Released under the MIT license