</pre><pre name="code" class="javascript">var dataJson={
    "BankName": {
        "value": "",
        "description": "银行名称",
        "type": "int",
        "sort": "1"
    },
    "DeductPrice": {
        "value": "",
        "description": "立减金额",
        "type": "float",
        "sort": "2",
        "child": 
            {
                "StartDeductRange": {
                    "value": "123",
                    "description": "立减开始范围"
                },
                "EndDeductRange": {
                    "value": "123.1",
                    "description": "立减结束范围"
                },
                "DeductRangePrice": {
                    "value": "121",
                    "description": "立减范围金额"
                }
            }
    },
    "PlatForm": {
        "value": "",
        "description": "预订平台",
        "type": "float",
        "sort": "3"
    }
};
for (var json in dataJson) {
	if (eval("dataJson." + json + ".child")) {
                        startDeductRange = " value='" + eval("dataJson." + json + ".child")[item].StartDeductRange.value + "'";
                        endDeductRange = " value='" + eval("dataJson." + json + ".child")[item].EndDeductRange.value + "'";
                        deductRangePrice = " value='" + eval("dataJson." + json + ".child")[item].DeductRangePrice.value + "'";
                        strController += "<tr id='tr" + intIndex + "'>"
                                                + "<td>开始范围:<input style=' width:50px'; type='text'"
                                                + startDeductRange + " οnkeyup='inputFloat(this);' />"
                                                + "</td><td>结束范围:<input style=' width:50px;' type='text' "
                                                + endDeductRange + " οnkeyup='inputFloat(this);' />"
                                                + "</td><td>立减金额:<input style=' width:50px;' type='text' "
                                                + deductRangePrice + " οnkeyup='inputFloat(this);' />";
                        strController += "</td><td><a id='deleteLink1' οnclick='deleteTr(tr" + intIndex + ");'>删除</a>   <a id='addLink" + intIndex + "' οnclick='addTr(this);' style='display:none;'>新增</a></td>"
                                     + "</tr>";
                        intIndex++;
                    }
}

</pre><pre code_snippet_id="268573" snippet_file_name="blog_20140401_1_2551640" name="code" class="javascript">
GitHub 加速计划 / js / json
41.72 K
6.61 K
下载
适用于现代 C++ 的 JSON。
最近提交(Master分支:1 天前 )
960b763e 2 个月前
8c391e04 5 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐