Skip to content

Latest commit

 

History

History
55 lines (34 loc) · 1.85 KB

readme.md

File metadata and controls

55 lines (34 loc) · 1.85 KB

Common.js

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.

Features

Includes common polyfills:

Also contains a small toolkit of fundamental operations, mapped in the "c" variable on the global namespace.

Install

Using bower:

bower install common.js

Methods

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

Credits

Initialized by Makis Tracend

Part of the Commons collection of web assets

Distributed by Makesites.org

License

Released under the MIT license