填报预览 , 时好时坏 对JS绝望了。 var identify = _g().getWidgetsByName("p7"); //p7 var score = _g().getWidgetsByName("p8"); var reason = _g().getWidgetsByName("p3"); var demp = ""; var ar = ""; var br = ""; //获取扩展单选按钮组p1的控件对象数组 if (identify[0] != undefined) { for (var i = 0; i < identify.length; i++) { if (score[i].getValue().length == 0) { ar = 0; } else { ar = score[i].getValue(); } if (reason[i].getValue().length == 0) { br = "无"; } else { br = reason[i].getValue(); } demp = demp + identify[i].getValue() + '&&' + ar + '&&' + br + ","; } } demp = demp.slice(0, demp.length - 1); alert(demp); var type = _g().getWidgetByName("p6").getValue(); var temp = { json: demp, type: type, }; FR.ajax({ url: "http://ycgtest.vaiwan.com/fr_plugin/inserJxkhInfo/insertJxkh", type: "POST", contentType: "application/json;charset=utf-8", dataType: "json", data: JSON.stringify(temp), success: function(data, textStatus) { alert(data.msg); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert("数据传输失败!"); }, complete: function(XMLHttpRequest, textStatus) { console.log("执行了"); } }); |