开发者

Can a yui aSync Request send objects as parameters?

开发者 https://www.devze.com 2023-01-02 10:03 出处:网络
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 s

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消