| Author |
Getting JQuery's serialize and load function to play together.
|
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
It seems that JQuery's serialize function returns a www-form-encoded string but the load function expects a JavaScript object. Is there a way to either get the serialize function to return an object (like with Prototype's serialize object) or to let the load function know that its being passed a string instead of an object (like with the 4th argument in JQuery's post method)?
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56230
|
|
|
I believe that you are looking for serializeArray() which will return a construct acceptable for load().
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56230
|
|
|
If you're going to be dealing with forms, you definitely want to check out the official jQuery Forms Plugin.
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Will do. Thanks, Bear. BTW: Should questions like this go here or in the Other Open Source Projects forum? The book promos always seem to end up here so it was my first guess.
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
That worked. I dismissed serializeArray because the description that I saw on one of the API pages didn't really describe this behavior. Got a good reference page that you use? I have a book on order but it's not here yet.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56230
|
|
Originally posted by Ben Souther: Should questions like this go here
Here. JavaScript questions would be best addressed here.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56230
|
|
Originally posted by Ben Souther: I dismissed serializeArray because the description that I saw on one of the API pages didn't really describe this behavior.
Yeah, the online docs for some of the methods is rather lame -- especially for newer methods like serializeArray() which was just added.
|
 |
 |
|
|
subject: Getting JQuery's serialize and load function to play together.
|
|
|