Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
jQuery Misc param() Method
The param() method in jQuery is used to create a serialized representation of an array or object.
Syntax
The syntax is as follows ?
$.param(obj, val)
Above, obj is the object to serialize, whereas Val specifies whether or not to use the traditional style of param serialization.
Example
Let us now see an example to implement the jQuery param() method?
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
ob = new Object();
ob.stdid = "S01";
ob.roll = 3;
$("button").click(function(){
$("p").text($.param(ob));
});
});
</script>
</head>
<body>
<h2>Student Details</h2>
<p></p>
<button>Serialized Representation</button>
</body>
</html>
Output
This will produce the following output?

Click on the button to get serialized representation?

Advertisements
