[jQuery] ajax form docs

2006-11-10 Thread Enquest
This is the documentation! $.ajax({ url: mydomain.com/url, type: POST, data: $.param( $(#form).formdata()), complete: myAjaxDone, success: myAjaxSuccess, error: myAjaxError }); However I can't find an explenation for this line. data: $.param( $(#form).formdata()) What

Re: [jQuery] ajax form docs

2006-11-10 Thread Mike Alsup
What is param and what is formdata formdata() is an old function that used to exist in the form plugin long ago. $.param is a core method which converts an object or an array into a query string. How can I submit a form then via ajax? Use the form plugin:

Re: [jQuery] ajax form docs

2006-11-10 Thread Jörn Zaefferer
Mike Alsup schrieb: $.param is a core method which converts an object or an array into a query string. I wonder if there is any case where one would use $.ajax without calling $.param for any data first. If not, it would be nice to simply integrate that call into $.ajax. -- Jörn

Re: [jQuery] ajax form docs

2006-11-10 Thread Mike Alsup
I wonder if there is any case where one would use $.ajax without calling $.param for any data first. If not, it would be nice to simply integrate that call into $.ajax. That's a good point, Jörn. ___ jQuery mailing list discuss@jquery.com

Re: [jQuery] ajax form docs

2006-11-10 Thread Jörn Zaefferer
Mike Alsup schrieb: I wonder if there is any case where one would use $.ajax without calling $.param for any data first. If not, it would be nice to simply integrate that call into $.ajax. That's a good point, Jörn. Of couse it would be an ugly API change. If that stuff is

Re: [jQuery] ajax form docs

2006-11-10 Thread Mike Alsup
Of couse it would be an ugly API change. If that stuff is integrated into $.ajax, we could savely deprecate $.get and $.post. Perhaps interrogating the type would work? if (typeof data != 'string') data = jQuery.param(data) ___ jQuery mailing

Re: [jQuery] ajax form docs

2006-11-10 Thread Jörn Zaefferer
Mike Alsup schrieb: Of couse it would be an ugly API change. If that stuff is integrated into $.ajax, we could savely deprecate $.get and $.post. Perhaps interrogating the type would work? if (typeof data != 'string') data = jQuery.param(data) Yeah, that should be pretty safe.

Re: [jQuery] ajax form docs

2006-11-10 Thread Mike Alsup
While we are at it: A get request can send it's data only by appending the query string to the URL, right? Can this be handled by $.ajax, too? Sure, it could. I think it makes sense to move all that logic into $.ajax but I would keep $.get and $.post because they are nice convenience methods.

Re: [jQuery] ajax form docs

2006-11-10 Thread Jörn Zaefferer
Mike Alsup schrieb: While we are at it: A get request can send it's data only by appending the query string to the URL, right? Can this be handled by $.ajax, too? Sure, it could. I think it makes sense to move all that logic into $.ajax but I would keep $.get and $.post because they

Re: [jQuery] ajax form docs

2006-11-10 Thread Mike Alsup
So don't see the need for $.get and $.post anymore. It's not a need, it's a convenience. Just like getJSON and getScript. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

Re: [jQuery] ajax form docs

2006-11-10 Thread Jörn Zaefferer
Mike Alsup schrieb: So don't see the need for $.get and $.post anymore. It's not a need, it's a convenience. Just like getJSON and getScript. Ok, $.get and $.post both provide an interface with static parameters, that makes them more convienent then $.ajax. Good to talk about it