http://dev.jquery.com/ticket/4388 Though I thought there was a bigger
master bug for this.
It's because of how for a long time jQuery has checked for "undefined"
arguments rather than checked for the length of the arguments.
As a result:
.css('width', undefined); would be interpreted as a css getter rather
than a css setter and without warning return a css value instead of the
jQuery object, as a result if you tried to chain from it you would
magically in an unexpected way get errors about it not being defined.
The same issue applied to a large number of jQuery methods like .attr,
.val, etc... which work as both getters and setters.
I was under the impression that this was on the todo list, rather than
already fixed, cause I could swear I ran into this while working with
the 1.3 series.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
John Resig wrote:
> Daniel -
>
> I'm not familiar with this issue - is there a ticket related to it?
>
> --John
>
>
>
> On Tue, Jun 16, 2009 at 11:11 PM, Daniel
> Friesen<[email protected]> wrote:
>
>> Hmmm? Clarifying, has $(el).css('width', undefined).someOtherFnMethod();
>> been fixed?
>>
>> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
>>
>> John Resig wrote:
>>
>>>> It's always a good idea to either use a ||'' or cast your data to a string
>>>> or other proper datatype when using jQuery, a large number of the methods
>>>> will have somewhat undesirable results if you try using null or undefined,
>>>> it's a known issue.
>>>>
>>>>
>>> Oh, I wouldn't go that far. We've patched any null/undefined issues
>>> that we've found. I'm not aware of any outstanding issues (save for
>>> the one mentioned in this thread). Pointers to any others would be
>>> appreciated.
>>>
>>> vdhant: You should file a bug with this point in it:
>>> http://dev.jquery.com/newticket
>>>
>>> --John
>>>
>>>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---