请问如何使用JS在填报提交后进行类别列的遍历? 消息推送JS设置 原推送JS if(A=="a") {var myarray={"msgtype": "news","news": {"articles" : [{"title" : title,"description" : cont,"url" :url]}} var json_myarray = JSON.stringify(myarray) $.ajax({ type: "POST", url: url2, data:json_myarray, header:{'Content-Type':'application/json'} }); } 加入遍历后 var temp = ""; var arr = _g().getWidgetsByName("p1"); //获取扩展单选按钮组p1的控件对象数组 if (arr[0] != undefined) { for (var i = 0; i < arr.length; i++) { temp = temp + arr[i].getValue() + ' '; //如果控件长度大于1,则遍历获取控件值并拼接 if(A=="a") {var myarray={"msgtype": "news","news": {"articles" : [{"title" : title,"description" : cont,"url" :url]}} var json_myarray = JSON.stringify(myarray) $.ajax({ type: "POST", url: url2, data:json_myarray, header:{'Content-Type':'application/json'} }); }} } } |