Serializes an array of form elements or an object (core of
.serialize() method).
Arguments
An Array or jQuery object is serialized by name/value pairs. An object by key/value pairs (As of jQuery 1.3, the return value of functions will be used instead of the function as a String).Examples
Serialize a key/value object.
var params = { width:1680, height:1050 };
var str = jQuery.param(params);
$("#results").text(str);
Full source:
Examples
Serialize a key/value object.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://code.jquery.com/jquery-1.5.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
var params = { width:1680, height:1050 };
var str = jQuery.param(params);
$("#results").text(str);
});
</script>
<style>div { color:red; }</style>
</head>
<body>
<div id="results"></div>
</body>
</html>
Was this information helpful?

