[jQuery] :empty pseudo-class and whitespaces

2007-12-03 Thread Christoph Roeder

Hello,

I think the :empty pseudo-class has a bug, the docs are wrong or I
misunderstood the docs.

The Problem is, that :empty only matches elements when they really
have no children, incl. textnodes with whitespaces or newlines.

http://docs.jquery.com/Selectors/empty
 Matches all elements that are empty, be it elements or text.

Example:
~~~
$(#test).is(:empty)
- returns: [ #test ], instead of an empty array


div id=test

/div


[jQuery] Re: :empty pseudo-class and whitespaces

2007-12-03 Thread Christoph Roeder

Thanks, I think this is much better.

Chris

On Dec 3, 3:03 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
 Does that help clarify it? If not, feel free to edit it directly in
 the wiki or reply to this with a suggestion for revision.


[jQuery] Re: jQuery 1.2 - Serialize a form as JSON

2007-09-21 Thread Christoph Roeder

Ok, Problem #1 is solved, but #2 isn't.

Now I've seen this in the jQuery Ajax-Docs [1]:

 If value is an Array, jQuery serializes multiple values with same key i.e. 
 {foo:[bar1, bar2]} becomes 'foo=bar1foo=bar2'.

WTF?

Why not like every browser does it?

'foo[]=bar1foo[]=bar2'

[1] http://docs.jquery.com/Ajax/jQuery.ajax#options

Thanks