Can a yui aSync Request send objects as parameters?
Is there a way that you can pass in a javascript object to a yui aSync request or does it only accep开发者_JS百科t a URI?
A YUI2 AsyncRequest sends a HTTP request to a URL using the request type you specify.
You are free to append information as query parameters for a GET or POST, or to send it as POST data.
To do so you could write a simple for in loop to iterate over your object & create a query string that you can then either set as the POST data or append to your URL if sending a GET. Be sure to use encodeURIComponent on the components as you are building your string.
精彩评论