I was unaware. I thought it might have been, so I checked the 1.2 docs, and it said nothing about passing a default value. So it must have been an undocumented feature?
On Mon, Oct 25, 2010 at 2:46 PM, Aaron Newton <[email protected]> wrote: > No one in this thread seems to have said these magic words: > > this was a breaking change from MooTools 1.2 > 1.3. > > > On Mon, Oct 25, 2010 at 2:18 PM, André Fiedler < > [email protected]> wrote: > >> k, that´s bad. Used it a lot. ;o) Thanks so far >> >> >> 2010/10/25 Sean McArthur <[email protected]> >> >>> You don't pass a default. Thats not a behavior of MooTools (I know Python >>> dictionaries use the default value though). >>> >>> To get a default value, just use the OR (default) operator. >>> >>> var text = myEl.get('text') || defaultText; >>> >>> >>> >>> On Mon, Oct 25, 2010 at 2:13 PM, André Fiedler < >>> [email protected]> wrote: >>> >>>> So, if i now can get multiple values, how do i pass a default? >>>> >>>> 2010/10/25 André Fiedler <[email protected]> >>>> >>>> I thought the second parameter is the "default" if text isn´t set? >>>>> >>>>> 2010/10/25 Sean McArthur <[email protected]> >>>>> >>>>> Because you're calling Element.get with multiple arguments. If you do >>>>>> that, you'll get an object with key/value pairs, with each key being one >>>>>> of >>>>>> the arguments you passed. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Mon, Oct 25, 2010 at 2:02 PM, André Fiedler < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> Why does this: >>>>>>> >>>>>>> http://jsfiddle.net/SunboX/Qhsej/ >>>>>>> >>>>>>> return an Object like that: >>>>>>> >>>>>>> Object >>>>>>> >>>>>>> 1. : null >>>>>>> 2. text: "Go" >>>>>>> 3. __proto__: Object >>>>>>> >>>>>>> >>>>>>> using 1.3? It doesn´t using 1.2 instead?! >>>>>>> >>>>>>> Thx, André! :o) >>>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >> >
