Support for encoding query string or POST data in YUI ?

Posted by faB on Stack Overflow See other posts from Stack Overflow or by faB
Published on 2009-07-08T07:50:43Z Indexed on 2010/04/16 20:33 UTC
Read the original article Hit count: 313

Filed under:
|
|

How do you encode a javascript object/hash (pairs of properties and values) into a URL-encoded query string with YUI (2.7.0 or 3.0.0 Beta) ?

I want to do the equivalent of Object.toQueryString() from Prototype:

I need this to encode parameters for GET and POST requests with YAHOO.util.Connect.

It turns out YAHOO.util.Connect has a setForm() method to serialize a form but that still leaves me out cold to encode parameters for GET requests, or the 4th parameter of YAHOO.util.Connect.asyncRequest() to pass post data.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about yui