JsonConvert.SerializeObject(model)
XmlDocument doc = new XmlDocument();
doc.LoadXml(cam.Cam_Config);
var camConfig = Newtonsoft.Json.JsonConvert.SerializeXmlNode(doc);
js 调用:
window.camConfig = [<%=(camConfig) %>];
if (camConfig.length>0) {
for(var property in camConfig[0].xml.cam) {
$(‘#‘+property).val(eval(‘camConfig[0].xml.cam.‘+property));
}
}
时间: 2024-10-12 04:13:02