Prototype - Object toQueryString() 方法
此方法将对象转换为其 URL 编码的查询字符串表示形式。
这是一种序列化形式,主要用于为 Ajax 命名空间中的对象(例如 Ajax.Request)等内容提供复杂的参数集。
语法
Object.toQueryString(obj);
返回值
返回编码字符串。
示例
<html>
<head>
<title>Prototype examples</title>
<script type = "text/javascript" src = "/javascript/prototype.js"></script>
<script>
function showResult() {
var o = { action: 'ship', order_id: 123,
fees: ['f1', 'f2'], 'label': 'a demo' };
alert("URI: " + Object.toQueryString(o) );
}
</script>
</head>
<body>
<p>单击按钮查看结果。</p>
<br />
<br />
<input type = "button" value = "Result" onclick = "showResult();"/>
</body>
</html>

prototype_basic_object.html