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

Reply via email to