Home >Web Front-end >JS Tutorial >Simple example of jQuery deep copying Json object

Simple example of jQuery deep copying Json object

高洛峰
高洛峰Original
2017-01-03 16:02:28930browse

The example in this article describes the simple implementation method of jQuery deep copying Json object. Share it with everyone for your reference, the details are as follows:

var oldJson = {
  Name: 'quber',
  List: [1, 2, 3, 4],
  Obj: [
   { name: 'qubernet', fun: function () { return 1; } },
   { name: 'qubernet1', fun: function () { return 2; } }
  ]
};
var newJson = $.extend(true, {}, oldJson);
console.log(JSON.stringify(newJson));

I hope this article will be helpful to everyone in jQuery programming.

For more jQuery deep copy Json object simple examples and related articles, please pay attention to the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn