Code Monkey home page Code Monkey logo

on.js's Introduction

on.js

return true;

A JavaScript Library

What is on.js?

This free library aims to help client-side programmers maintain performance and functionality in the cross-browser environment, where the JavaScript run-time manages HTML/CSS content and presentation.

Allow me to thank some of the great people that can relate!

Supporters!

Thank(You);

XirSys, awesome, free WebRTC Cloud Service!

  • making the web a better place

Alex Thomas, great guy and start-up founder of Pylon.io!

  • seeing on's benefit in Pylon's future web success

Contributers!

Thank(You);

John-David Dalton, great guy and the creator of Lo-Dash!

  • renaming on's toString return value

What is on.js?

A Javascript Library

It uniquely integrates the essentials of web JavaScript.

  • a.) Best-practices
  • b.) Cross-browser compatability
  • c.) DOM iteration/manipulation
  • d.) Event callbacks
  • e.) Ajax polling
  • f.) File-uploading
  • g.) Script-loading
  • h.) Asynchronous scope-intelligence
  • i.) Datatype-detection
  • j.) Iframes and more!

Including optional resources for development:

    • Scope-intelligent console wiki

A Keyword

on

The single keyword, on, sweetens your javascript with two flavors of sugar!


A Syntax

(command)[on](data)(parameter);

Friendly and intuitive!

====================================

('mouseup')[on](theElement)
(   function(e)
    {   
        this;
    }
);
('for each img')[on](theElement)
(   function(i)
    {   
        this[i];
        return false;
    }
);
('POST applesauce=true')[on]('../ajax/url/?topic=food')
(   function()
    {   
        this.POST;
        this.GET;
        this.responseText;
    }
);

A Standard

on[type];

Conventional augmentation!

====================================

on.document.eachElementByAttribute
(   'the-attribute'
,   'the-value'
,   function(i)                        
    {
        this[i];                  
        return false;
    }
);
on.element.offsetLeft.call(theElement);
on.iframe.document(theIframeElement);

A Paradigm

this instanceof Cool;

Fluidly adapts to your HTML with

  • Hybrid functionality!
  • Nestable bindings!
  • Graceful degradation!
  • Polyfill!
  • & More!

====================================

<form id="TheUploadForm" action="../the/static/url">

	<input type="file" value="Select A File" />

	<input type="submit" value="Submit" />

</form>
('submit')[on](document.getElementById('TheUploadForm'))
(	function(e)
	{
		on.event.preventDefault.call(e);
		
		this.action = "../the/ajax/url";
	
		('upload')[on](this)
		(	function(e)
			{
				console.log( 100 * ( e.loaded/e.total ) + "%" )
			}
		);

		('POST')[on](this)
		(	function()
			{
				console.log( this.responseText )
			}
		);
	}
);

A Mentor

on.about();

Live console manual!

source: /opt/on.about.js

  • Inject during development
  • Delete during production

method: on.about()

  • Call anywhere!
  • Asynchronously scope-intelligent

====================================

var contentBody = document.getElementById('content-body');
var contentTabs = document.getElementById('content-tabs');

var activeTab;

('mouseover')[on](contentTabs.children)
(   function(e)
    {
        on.event.preventDefault.call(e);
        on.about(); //prints man page for Events on Elements
        
        var me = activeTab = this;

        ('GET')[on](this.href+"?ajax=true")
        (   function()
            {
            	if (activeTab != me) return;
            	
                on.about(); //prints man page for ajax GET on URL
                contentBody.innerHTML = this.responseText;
            }
        );
    }
);

on.about(); //prints man page for on.js

A Performance

Benchmarks!

DOM

Classes

Attributes


alt text


A Revolution

Download the source!

Beginners, grab this too!

Check out the tutorials!

Bookmark the wiki!


on.js's People

Watchers

The Gitter Badger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.