get/set vs. store/retrieve

47 views
Skip to first unread message

stratboy

unread,
Dec 29, 2008, 5:26:30 AM12/29/08
to MooTools Users
Hi!

after a lot of mootools programming and docs studies, I still have a
little question:

when should I use get/set and when store/retrieve? Or, in other words,
what's the best use for get/set and what's the best for store/
retrieve?

Martin Tillmann

unread,
Dec 29, 2008, 11:19:43 AM12/29/08
to mootool...@googlegroups.com
with get and set you can modify and read elements' attributes. I use store and retrieve to store data on elements that would be awkward or impossible (depending on the browser) to store in an (non-existent) attribute. 
--
/* Martin Tillmann / mtil...@gmail.com / 0221 302 3826 / 0179 947 9963 / Severinstraße 2 / 50678 Köln */

nutron

unread,
Dec 29, 2008, 11:30:19 AM12/29/08
to mootool...@googlegroups.com
I just went ahead and posted this to my blog, as my answer, I thought, might be useful to others to read. Includes code examples and whatnot.

The MooTools Tutorial: www.mootorial.com Clientcide: www.clientcide.com


View this message in context: Re: get/set vs. store/retrieve
Sent from the MooTools Users mailing list archive at Nabble.com.

Michal

unread,
Dec 29, 2008, 1:09:38 PM12/29/08
to MooTools Users
If it's ok, I have related questions: what about creating custom
properties returned by "get" and "set": when should it be done? At

http://mootools.net/docs/Element/Element#Element-Properties

the example uses the "setAttribute" method: what is that for? When
should that be used? Also, the fact that the Tween is returned by
"get" rather than "retrieve" confuses me. Why is it get and not
retrieve? Is it that "get" allows for some custom actions upon "get"?

Michal.

On Dec 29, 4:30 pm, nutron <anut...@gmail.com> wrote:
> I just went ahead and posted this to my blog, as my answer, I thought, might
> be useful to others to read. Includes code examples and whatnot.
>
> http://www.clientcide.com/your-questions/the-difference-between-eleme...
>
> On Mon, Dec 29, 2008 at 2:26 AM, stratboy (via Nabble) <
> ml-user+89945-1375813...@n2.nabble.com<ml-user%2B89945-1375813...@n2.nabble.com>
>
>
>
> > wrote:
>
> > Hi!
>
> > after a lot of mootools programming and docs studies, I still have a
> > little question:
>
> > when should I use get/set and when store/retrieve? Or, in other words,
> > what's the best use for get/set and what's the best for store/
> > retrieve?
>
> > ------------------------------
> >  View message @
> >http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2077828.html
> > To start a new topic under MooTools Users, email
> > ml-node+660466-1583815...@n2.nabble.com<ml-node%2B660466-1583815...@n2.nabble.com>
> > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> -----
> The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> Clientcide:  http://www.clientcide.comwww.clientcide.com
> --
> View this message in context:http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089367.html

nutron

unread,
Dec 29, 2008, 1:31:50 PM12/29/08
to mootool...@googlegroups.com
retrieve and store are useful for storing data *on a specific element*, while getters and setters are applied to *all* elements.

i.e. 
myElement.store('myeffect', myInstanceOfFxTween);

This is useful for storing a specific property with a specific element. Getters/setters are useful for defining behavior for all elements:

el.set('tween', options).tween('opacity', 0); <<an instance of Fx.Tween for el is *implied*

On Mon, Dec 29, 2008 at 10:10 AM, Michal-2 (via Nabble) <ml-user%2B55915-776128202@...> wrote:

If it's ok, I have related questions: what about creating custom
properties returned by "get" and "set": when should it be done? At

http://mootools.net/docs/Element/Element#Element-Properties

the example uses the "setAttribute" method: what is that for? When
should that be used? Also, the fact that the Tween is returned by
"get" rather than "retrieve" confuses me. Why is it get and not
retrieve? Is it that "get" allows for some custom actions upon "get"?

Michal.

On Dec 29, 4:30 pm, nutron <anut...@...> wrote:

> I just went ahead and posted this to my blog, as my answer, I thought, might
> be useful to others to read. Includes code examples and whatnot.
>
> http://www.clientcide.com/your-questions/the-difference-between-eleme...
>
> On Mon, Dec 29, 2008 at 2:26 AM, stratboy (via Nabble) <
>

>
>
> > wrote:
>
> > Hi!
>
> > after a lot of mootools programming and docs studies, I still have a
> > little question:
>
> > when should I use get/set and when store/retrieve? Or, in other words,
> > what's the best use for get/set and what's the best for store/
> > retrieve?
>
> > ------------------------------
> >  View message @
> >http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2077828.html
> > To start a new topic under MooTools Users, email
> > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> -----
> The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> Clientcide:  http://www.clientcide.comwww.clientcide.com
> --
> View this message in context:http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089367.html
> Sent from the MooTools Users mailing list archive at Nabble.com.
The MooTools Tutorial: www.mootorial.com Clientcide: www.clientcide.com


View this message in context: Re: get/set vs. store/retrieve

Michal

unread,
Dec 29, 2008, 1:36:39 PM12/29/08
to MooTools Users
Ah! Thanks, that makes it clear. But what about "setAttribute" in
custom get/setters?

Michal.

On Dec 29, 6:31 pm, nutron <anut...@gmail.com> wrote:
> retrieve and store are useful for storing data *on a specific element*,
> while getters and setters are applied to *all* elements.
> i.e.
> myElement.store('myeffect', myInstanceOfFxTween);
>
> This is useful for storing a specific property with a specific element.
> Getters/setters are useful for defining behavior for all elements:
>
> el.set('tween', options).tween('opacity', 0); <<an instance of Fx.Tween for
> el is *implied*
>
> On Mon, Dec 29, 2008 at 10:10 AM, Michal-2 (via Nabble) <
> ml-user+55915-776128...@n2.nabble.com<ml-user%2B55915-776128...@n2.nabble.com>
>
>
>
> > wrote:
>
> > If it's ok, I have related questions: what about creating custom
> > properties returned by "get" and "set": when should it be done? At
>
> >http://mootools.net/docs/Element/Element#Element-Properties
>
> > the example uses the "setAttribute" method: what is that for? When
> > should that be used? Also, the fact that the Tween is returned by
> > "get" rather than "retrieve" confuses me. Why is it get and not
> > retrieve? Is it that "get" allows for some custom actions upon "get"?
>
> > Michal.
>
> > On Dec 29, 4:30 pm, nutron <anut...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089676&i=0>>
> > wrote:
>
> > > I just went ahead and posted this to my blog, as my answer, I thought,
> > might
> > > be useful to others to read. Includes code examples and whatnot.
>
> > >http://www.clientcide.com/your-questions/the-difference-between-eleme...
>
> > > On Mon, Dec 29, 2008 at 2:26 AM, stratboy (via Nabble) <
> > > ml-user+89945-1375813...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089676&i=1>
> > <ml-user%2B89945-1375813...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089676&i=2>>
>
> > > > wrote:
>
> > > > Hi!
>
> > > > after a lot of mootools programming and docs studies, I still have a
> > > > little question:
>
> > > > when should I use get/set and when store/retrieve? Or, in other words,
> > > > what's the best use for get/set and what's the best for store/
> > > > retrieve?
>
> > > > ------------------------------
> > > >  View message @
> > > >http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2077828.html
> > > > To start a new topic under MooTools Users, email
> > > > ml-node+660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089676&i=3>
> > <ml-node%2B660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089676&i=4>>
>
> > > > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> > > -----
> > > The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> > > Clientcide:  http://www.clientcide.comwww.clientcide.com
> > > --
> > > View this message in context:
> >http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089367.html
> > > Sent from the MooTools Users mailing list archive at Nabble.com.
>
> > ------------------------------
> >  View message @
> >http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089676.html
> > To start a new topic under MooTools Users, email
> > ml-node+660466-1583815...@n2.nabble.com<ml-node%2B660466-1583815...@n2.nabble.com>
> > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> -----
> The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> Clientcide:  http://www.clientcide.comwww.clientcide.com
> --
> View this message in context:http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089751.html

nutron

unread,
Dec 29, 2008, 1:45:43 PM12/29/08
to mootool...@googlegroups.com
setAttribute is a specific method for setting an element attribute that's native.

You can use set and setAttribute to the same effect for, say, img.src, but you couldn't use setAttribute for innerHTML because it isn't an attribute.

For all intents and purposes, you should always use .set.

On Mon, Dec 29, 2008 at 10:37 AM, Michal-2 (via Nabble) <ml-user%2B55915-776128202@...> wrote:

Ah! Thanks, that makes it clear. But what about "setAttribute" in
custom get/setters?

Michal.

On Dec 29, 6:31 pm, nutron <anut...@...> wrote:

> retrieve and store are useful for storing data *on a specific element*,
> while getters and setters are applied to *all* elements.
> i.e.
> myElement.store('myeffect', myInstanceOfFxTween);
>
> This is useful for storing a specific property with a specific element.
> Getters/setters are useful for defining behavior for all elements:
>
> el.set('tween', options).tween('opacity', 0); <<an instance of Fx.Tween for
> el is *implied*
>
> On Mon, Dec 29, 2008 at 10:10 AM, Michal-2 (via Nabble) <
> > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> -----
> The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> Clientcide:  http://www.clientcide.comwww.clientcide.com
> --
> View this message in context:http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089751.html

> Sent from the MooTools Users mailing list archive at Nabble.com.
The MooTools Tutorial: www.mootorial.com Clientcide: www.clientcide.com


View this message in context: Re: get/set vs. store/retrieve

Michal

unread,
Dec 29, 2008, 1:57:15 PM12/29/08
to MooTools Users
What about "setProperty"? The example at http://mootools.net/docs/Element/Element#Element:setProperty
uses it to set img.src . So now there seem to be three ways of setting
the src of an image:

set
setAttribute
setProperty

When should setProperty be used?

Michal.


On Dec 29, 6:45 pm, nutron <anut...@gmail.com> wrote:
> setAttribute is a specific method for setting an element attribute that's
> native.
> You can use set and setAttribute to the same effect for, say, img.src, but
> you couldn't use setAttribute for innerHTML because it isn't an attribute.
>
> For all intents and purposes, you should always use .set.
>
> On Mon, Dec 29, 2008 at 10:37 AM, Michal-2 (via Nabble) <
> ml-user+55915-776128...@n2.nabble.com<ml-user%2B55915-776128...@n2.nabble.com>
>
>
>
> > wrote:
>
> > Ah! Thanks, that makes it clear. But what about "setAttribute" in
> > custom get/setters?
>
> > Michal.
>
> > On Dec 29, 6:31 pm, nutron <anut...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089764&i=0>>
> > wrote:
>
> > > retrieve and store are useful for storing data *on a specific element*,
> > > while getters and setters are applied to *all* elements.
> > > i.e.
> > > myElement.store('myeffect', myInstanceOfFxTween);
>
> > > This is useful for storing a specific property with a specific element.
> > > Getters/setters are useful for defining behavior for all elements:
>
> > > el.set('tween', options).tween('opacity', 0); <<an instance of Fx.Tween
> > for
> > > el is *implied*
>
> > > On Mon, Dec 29, 2008 at 10:10 AM, Michal-2 (via Nabble) <
> > > ml-user+55915-776128...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089764&i=1>
> > <ml-user%2B55915-776128...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089764&i=2>>
> > > > ml-node+660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089764&i=3>
> > <ml-node%2B660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089764&i=4>>
>
> > > > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> > > -----
> > > The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> > > Clientcide:  http://www.clientcide.comwww.clientcide.com
> > > --
> > > View this message in context:
> >http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089751.html
> > > Sent from the MooTools Users mailing list archive at Nabble.com.
>
> > ------------------------------
> >  View message @
> >http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089764.html
> > To start a new topic under MooTools Users, email
> > ml-node+660466-1583815...@n2.nabble.com<ml-node%2B660466-1583815...@n2.nabble.com>
> > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> -----
> The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> Clientcide:  http://www.clientcide.comwww.clientcide.com
> --
> View this message in context:http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089799.html

nutron

unread,
Dec 29, 2008, 2:01:38 PM12/29/08
to mootool...@googlegroups.com
My bad, I confused myself.

In my post previously I meant to be talking about setProperty. setAttribute is a native method: 

setProperty is MooTools' wrapper for that method that helps you manage removing properties (setting them to null) as well as ensuring that properties that should be booleans (like checked) are set propertly.

So set and setProperty are both used to set attributes, but set has additional functionality and should always be used.

On Mon, Dec 29, 2008 at 10:57 AM, Michal-2 (via Nabble) <ml-user%2B55915-776128202@...> wrote:

What about "setProperty"? The example at http://mootools.net/docs/Element/Element#Element:setProperty
uses it to set img.src . So now there seem to be three ways of setting
the src of an image:

set
setAttribute
setProperty

When should setProperty be used?

Michal.


On Dec 29, 6:45 pm, nutron <anut...@...> wrote:

> setAttribute is a specific method for setting an element attribute that's
> native.
> You can use set and setAttribute to the same effect for, say, img.src, but
> you couldn't use setAttribute for innerHTML because it isn't an attribute.
>
> For all intents and purposes, you should always use .set.
>
> On Mon, Dec 29, 2008 at 10:37 AM, Michal-2 (via Nabble) <
> > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> -----
> The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> Clientcide:  http://www.clientcide.comwww.clientcide.com
> --
> View this message in context:http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089799.html

> Sent from the MooTools Users mailing list archive at Nabble.com.
The MooTools Tutorial: www.mootorial.com Clientcide: www.clientcide.com


View this message in context: Re: get/set vs. store/retrieve

Michal

unread,
Dec 29, 2008, 2:19:19 PM12/29/08
to MooTools Users
I think I just about "get" it (sorry... I'm awful) so:

"set" is a wrapper for
"setProperty" which is a wrapper for
"setAttribute"

However, if "set" should always be used, why is "setProperty" a public
method?

Michal.

On Dec 29, 7:01 pm, nutron <anut...@gmail.com> wrote:
> My bad, I confused myself.
> In my post previously I meant to be talking about setProperty. setAttribute
> is a native method:
>
> https://developer.mozilla.org/en/DOM/element.setAttribute
>
> setProperty is MooTools' wrapper for that method that helps you manage
> removing properties (setting them to null) as well as ensuring that
> properties that should be booleans (like checked) are set propertly.
>
> So set and setProperty are both used to set attributes, but set has
> additional functionality and should always be used.
>
> On Mon, Dec 29, 2008 at 10:57 AM, Michal-2 (via Nabble) <
> ml-user+55915-776128...@n2.nabble.com<ml-user%2B55915-776128...@n2.nabble.com>
>
>
>
> > wrote:
>
> > What about "setProperty"? The example at
> >http://mootools.net/docs/Element/Element#Element:setProperty
> > uses it to set img.src . So now there seem to be three ways of setting
> > the src of an image:
>
> > set
> > setAttribute
> > setProperty
>
> > When should setProperty be used?
>
> > Michal.
>
> > On Dec 29, 6:45 pm, nutron <anut...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089837&i=0>>
> > wrote:
>
> > > setAttribute is a specific method for setting an element attribute that's
>
> > > native.
> > > You can use set and setAttribute to the same effect for, say, img.src,
> > but
> > > you couldn't use setAttribute for innerHTML because it isn't an
> > attribute.
>
> > > For all intents and purposes, you should always use .set.
>
> > > On Mon, Dec 29, 2008 at 10:37 AM, Michal-2 (via Nabble) <
> > > ml-user+55915-776128...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089837&i=1>
> > <ml-user%2B55915-776128...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089837&i=2>>
> > > > ml-node+660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089837&i=3>
> > <ml-node%2B660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089837&i=4>>
>
> > > > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> > > -----
> > > The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> > > Clientcide:  http://www.clientcide.comwww.clientcide.com
> > > --
> > > View this message in context:
> >http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089799.html
> > > Sent from the MooTools Users mailing list archive at Nabble.com.
>
> > ------------------------------
> >  View message @
> >http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089837.html
> > To start a new topic under MooTools Users, email
> > ml-node+660466-1583815...@n2.nabble.com<ml-node%2B660466-1583815...@n2.nabble.com>
> > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> -----
> The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> Clientcide:  http://www.clientcide.comwww.clientcide.com
> --
> View this message in context:http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089851.html

nutron

unread,
Dec 29, 2008, 2:52:05 PM12/29/08
to mootool...@googlegroups.com
MooTools has a philosophy that any method that is defined in JS be used whenever possible and, when that method is insufficient, that a new method be used that replaces it. So, MooTools has setProperty that adds cross-browser support and other conveniences for setAttribute.

Element.set, on the other hand, is just a shortcut method for all the others. You can use set to set styles (element.setStyles), events, element.addEvents), properties/attributes (element.setProperties), etc. So set is kind of an overloaded method with a lot of functionality, but set must itself call something to assign these values. Rather than put the cross-browser conveniences inside set, MooTools has stand alone methods for all of set's functionality (well, most of it - not the custom setters/getters those *have* to use set). Thus:

set -> setStyle/setStyles
set -> addEvent/addEvents
set -> setProperty/setProperties

set wraps up all these methods into a single interface, but MooTools exposes the logic that set uses in methods of their own for greater extensibility and access.

I rarely use .set to setStyles - I just use setStyles because on its own it doesn't save may bites. I do use set for setProperties. Consider:

el.setStyles({ display: 'block', border: 'none' });
el.set({ styles: { display: 'block', border: 'none' } }); //harder to type out

el.setProperties({ src: '/foo.jpg', alt: 'foo' });
el.set({ src: '/foo.jpg', alt: 'foo' }); //easier than above

I *do* use set when I want to set numerous things:
el.set({
  src: '/foo.jpg',
  alt: 'foo',
  styles: { display: 'block', border: 'none' },
  events: {etc...}
});

I also use it when I create new elements:

new Element('img', {
  src: '/foo.jpg',
  alt: 'foo',
  styles: { display: 'block', border: 'none' },
  events: {etc...}
});

When you create an element and pass a second argument it's just passed along to .set.

So set is a convenience wrapper, but the methods set uses are exposed for your use if you care to reference them directly.

On Mon, Dec 29, 2008 at 11:19 AM, Michal-2 (via Nabble) <ml-user%2B55915-776128202@...> wrote:

I think I just about "get" it (sorry... I'm awful) so:

"set" is a wrapper for
"setProperty" which is a wrapper for
"setAttribute"

However, if "set" should always be used, why is "setProperty" a public
method?

Michal.

On Dec 29, 7:01 pm, nutron <anut...@...> wrote:

> My bad, I confused myself.
> In my post previously I meant to be talking about setProperty. setAttribute
> is a native method:
>
> https://developer.mozilla.org/en/DOM/element.setAttribute
>
> setProperty is MooTools' wrapper for that method that helps you manage
> removing properties (setting them to null) as well as ensuring that
> properties that should be booleans (like checked) are set propertly.
>
> So set and setProperty are both used to set attributes, but set has
> additional functionality and should always be used.
>
> On Mon, Dec 29, 2008 at 10:57 AM, Michal-2 (via Nabble) <
> > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> -----
> The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> Clientcide:  http://www.clientcide.comwww.clientcide.com
> --
> View this message in context:http://n2.nabble.com/get-set-vs.-store-retrieve-tp2077828p2089851.html

> Sent from the MooTools Users mailing list archive at Nabble.com.
The MooTools Tutorial: www.mootorial.com Clientcide: www.clientcide.com


View this message in context: Re: get/set vs. store/retrieve

Michal

unread,
Dec 29, 2008, 3:03:14 PM12/29/08
to MooTools Users
Thank you! That is a very full answer. I think I do get it now. And
sorry if I somewhat hijacked this thread...

Michal.
> ml-user+55915-776128...@n2.nabble.com<ml-user%2B55915-776128...@n2.nabble.com>
>
> > wrote:
>
> > I think I just about "get" it (sorry... I'm awful) so:
>
> > "set" is a wrapper for
> > "setProperty" which is a wrapper for
> > "setAttribute"
>
> > However, if "set" should always be used, why is "setProperty" a public
> > method?
>
> > Michal.
>
> > On Dec 29, 7:01 pm, nutron <anut...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089903&i=0>>
> > wrote:
>
> > > My bad, I confused myself.
> > > In my post previously I meant to be talking about setProperty.
> > setAttribute
> > > is a native method:
>
> > >https://developer.mozilla.org/en/DOM/element.setAttribute
>
> > > setProperty is MooTools' wrapper for that method that helps you manage
> > > removing properties (setting them to null) as well as ensuring that
> > > properties that should be booleans (like checked) are set propertly.
>
> > > So set and setProperty are both used to set attributes, but set has
> > > additional functionality and should always be used.
>
> > > On Mon, Dec 29, 2008 at 10:57 AM, Michal-2 (via Nabble) <
> > > ml-user+55915-776128...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089903&i=1>
> > <ml-user%2B55915-776128...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2089903&i=2>>
> ...
>
> read more »

stratboy

unread,
Dec 30, 2008, 7:37:03 AM12/30/08
to MooTools Users

> setProperty is MooTools' wrapper for that method that helps you manage
> removing properties (setting them to null)

@nutron: isn't it better to use removeProperty() ?

stratboy

unread,
Dec 30, 2008, 7:37:39 AM12/30/08
to MooTools Users

@nutron: thank you very much for the blog post. Thank you.

nutron

unread,
Dec 30, 2008, 11:45:55 AM12/30/08
to mootool...@googlegroups.com
It is better to use that, but setProperty also ensures that the value is removed if you set something to null or undefined. This can be useful if you're passing a variable to the method that may be defined or may not be. You can let MooTools worry about what to do with it. It also means you can use .set to define numerous things, including null values.
Reply all
Reply to author
Forward
0 new messages