On Fri, Jan 15, 2010 at 8:28 PM, "Cowboy" Ben Alman <cow...@rj3.net> wrote:
> jquery.ajaxSettings.traditional is undefined by default, but since we > only test its value in a "truthy" way, it shouldn't matter whether it > defaults to false or undefined. Defaulting to undefined safes a few > bytes. > Ok, I expected genuine false from the code comments. It just didn't auto-complete in js-shell -- I saw (some?) other ajaxSettings do, and I thought it would be more consistent, too. > That being said, maybe the $.serialize() method also needs a > `traditional` flag. I personally think that progressive enhancement > patterns should always be used, such that form elements in the page > should have their name encoded as the server expects (so that a > default non-JavaScript or non-AJAX submit works normally). This way, > the names of form "array" elements submitted to PHP should end in [], > and the form should usually be serialized in the `traditional` way. > I'm not sure I completely understand. $.serialize() does what a browser would do. Doing it different seems odd. If you want to allow non "[]" - variables to come out as array in PHP you would either send every variable as array, or find out which input-names appear more than once in the form ... (???) Tobias > On Jan 14, 10:52 am, Tobias Hoffmann <smilingt...@googlemail.com> > wrote: > > --- Part 2 --- > > @John, Ben: I expected > > jquery.ajaxSettings.traditional === false > > by default. But it isn't (in 1.4rc1), its undefined. Also in > > > > http://github.com/cowboy/jquery/commit/4ea851e08841447ba3550dc54785b3... > > the test case says in Line 263 > > equals( !jQuery.ajaxSettings.traditional, true, "traditional flag, > falsy > > by default" ); > > but !undefined is also true. Note that in Line 175 of src/ajax.js the > > traditional: false, > > appears only inside a comment. > > > > This looks like a bug. >--
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-...@googlegroups.com.
To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.