Menu

Home

James Stortz

on.js

return true;

A JavaScript Library

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;
    }
);


:::javascript

('for each img')[on](theElement)
(   function(i)
    {   
        this[i];
        return false;
    }
);


:::javascript

('POST applesauce=true')[on]('../ajax/url/?topic=food')
(   function()
    {   
        this.POST;
        this.GET;
        this.responseText;
    }
);

A Standard

on[type];

Conventional methods!

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

on.document.eachElementByAttribute
(   'the-attribute'
,   'the-value'
,   function(i)                        
    {
        this[i];                  
        return false;
    }
);

:::javascript
on.element.offsetLeft.call(theElement);

:::javascript
on.iframe.document(theIframeElement);

A Performance

Benchmarks!

DOM
* http://jsperf.com/on-js-dom-benchmark
* http://jsperf.com/javascript-dom-benchmark

Classes
* http://jsperf.com/on-js-classes-benchmark
* http://jsperf.com/javascript-classes-benchmark

Attributes
* http://jsperf.com/on-js-attributes-benchmark
* http://jsperf.com/javascript-attributes-benchmark


alt text


A Revolution

Download the source!

Beginners, grab this too!

Check out the tutorials!

Bookmark the wiki!



Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.