The

$.extend({preload: function(){...});

seems to be equal to:

$.preload = function(){ ... };

In MooTools we have something similar, for Types, like String/Array/Element
etc. we have http://mootools.net/docs/core/Core/Core#Type:extend

A bit later on $.extend({}, {}, ...) is used for the options.

This is basically equal to Object.append({}, {}, ...);
http://mootools.net/docs/core/Types/Object#Object:Object-append

Additionally something often used in jQuery is $.fn.bar = function(){ ... }
This is actually adding a method to $() so you can do $('div').bar(); It's
a little trick, but $.fn == $.prototype, which is native JavaScript.
MooTools can do that too, For example String.prototype.foo = function(){
... } or Element.prototype.bar = function(){ ... } which lets to do
respectively 'ymString'.foo() or $('myElement').bar(). To make this easier
we have Type.implement() (
http://mootools.net/docs/core/Core/Core#Type:implement)



On Tue, Feb 21, 2012 at 1:08 PM, hamburger <[email protected]> wrote:

> Hello, I'am learning moo by doing. I found some jquery-stuff i would
> like to translate.
> but i do not understand the code. Where is the loaded-function called?
> I see only the setting.loaded-function.
>
> http://jsfiddle.net/4YsUV/2/
>
> maybe I get some help here?
> thanks in advance.
>

Reply via email to