<html>
<head></head>
<body></body>
<script>
// 定義一個 JSON 物件
var Jas = {
"resourceType": "Patient",
"name": [{
"use": "official",
"text": "林帶玉",
"family": "林",
"given": ["帶玉"]
}],
"gender": "female",
"birthDate": "1773-01-21",
};
// 將 Jas 物件 birthDate 資料指定給 ret 變數
Jas.birthDate = "2000-01-01"; // 改變JSON物件值
var ret = JSON.stringify(Jas); // 物件轉字串
//alert(ret); // 網頁彈出顯示 ret 結果
document.write(ret)
var ret1 = Jas.name[0].text;
document.write("<br><br>MY Name:", ret1)
</script>
</html>