Over a million developers have joined DZone.

MooTools Starter

·
Starting with an anonymous function

window.addEvent('domready', function() {
    // Put your code here, similar to jQUery's jQuery(function($){});
});


Starting with a predefined function

var myFunction = function() {
    alert('MooTools!');
};

window.addEvent('domready', myFunction());


Starting with a predefined function and an anonymous function

window.addEvent('domready', function() {
    myFunction();
    
    // Additional code
});
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}