81,090
社区成员
发帖
与我相关
我的任务
分享
function findprod(locationid){
var id=locationid;
xml = new ActiveXObject("Microsoft.XMLHTTP");
xml.open("POST","mytest.jsp?i="+id+"",false);
xml.send();
<%
int count=0;
String tid=request.getParameter("i");
Set select=new HashSet();
String p_brand="";
String hqla="select distinct PBrand from DiyProd where t_id='"+tid+"'";
if(tid!=null){
List prods=hn.query(hqla);
%>
var subcat = new Array(<%=prods.size()%>); // 声明js数组时要给出数组的大小
<%
Iterator it=prods.iterator();
while(it.hasNext()){
p_brand=(String)it.next();
System.out.println(count);
System.out.println(p_brand+"---");
%>
subcat[ parseInt(<%=count%>)]=' <%=p_brand%>'; // // 这里需要转换一下类型
<%
count++;
}
}
%>
}
function findprod(locationid){
var id=locationid;
xml = new ActiveXObject("Microsoft.XMLHTTP");
xml.open("POST","mytest.jsp?i="+id+"",false);
xml.send();
<%
int count=0;
String tid=request.getParameter("i");
Set select=new HashSet();
String p_brand="";
String hqla="select distinct PBrand from DiyProd where t_id='"+tid+"'";
if(tid!=null){
List prods=hn.query(hqla);
%>
var subcat = new Array(<%=prods.size()%>); [color=#FF0000]// 声明js数组时要给出数组的大小[/color]<%
Iterator it=prods.iterator();
while(it.hasNext()){
p_brand=(String)it.next();
System.out.println(count);
System.out.println(p_brand+"---");
%>
subcat[ <%=count%>]=' <%=p_brand%>';
<%
count++;
}
}
%>
}