举例:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
    personObj = new Object();
    personObj.firstname = "John";
    personObj.lastname = "Doe";
    personObj.age = 50;
    personObj.eyecolor = "blue"; 
    $("button").click(function(){
        $("div").text($.param(personObj));
    });
});
</script>
</head>
<body>

<button>Serialize object</button>

<div></div>

</body>
</html>
View Code

相关文章:

  • 2021-07-28
  • 2022-01-29
  • 2021-08-12
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2022-01-31
猜你喜欢
  • 2021-06-10
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2022-02-05
  • 2022-12-23
  • 2021-12-26
相关资源
相似解决方案