JavaScript 中的 JSON. stringify() 函数
javascripthtmlfront end technologyjson更新于 2024/10/2 16:12:17
JSON 对象的 stringify() 函数接受 JSON 字符串,并根据给定的文本构造一个对象并返回它。
语法
其语法如下
Json.stringify();
示例
<html>
<head>
<title>JavaScript 示例</title>
</head>
<body>
<script type="text/javascript">
var jsonSample = '{Tutorial: Java, Version:8}';
jsonObj = JSON.stringify(jsonSample);
document.write(jsonObj);
</script>
</body>
</html>
输出
"{Tutorial: Java, Version:8}"
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

