如何用JS调用某个JSP里<%%>块语句?
2个回答
展开全部
var post="";//构造要携带的数据
xml.open("POST","../jsp/queryCS/test.jsp?cs=11",false);//使用POST方法打开一个到服务器的连接,以异步方式通信
xml.setrequestheader("content-length",post.length);
xml.setrequestheader("content-type","application/x-www-form-urlencoded");
xml.send(post);//发送数据//返回结果var v = xml.responseText;
//处理这个结果
document.getElementById("selectfact").innerHTML='<SELECT size=1 name=postercn>' + v ;}</script><%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.util.*"%>
<%@ page import="java.util.List"%>
<%@ page import="com.yc.ycportal.util.CacheTree"%>
<%@ page import="java.util.StringTokenizer"%>
<html><BODY><%String strchangshang=(String)request.getParameter("cs");
String cname=(String)request.getParameter("cscn");
String allquery_str="";
System.out.println("厂商"+strchangshang);
String all_factory="";// {List list = CacheTree.getAll_son_Tree(strchangshang);
String str_fact_id_name = "";
String fact_id = "";
String fact_name = "";
for (int i = 0; i < list.size(); i++) {
str_fact_id_name = (String) list.get(i);
StringTokenizer st = new StringTokenizer(
str_fact_id_name, "◆"); fact_id = st.nextToken();
fact_name = st.nextToken(); if ("".equals(allquery_str))
allquery_str = fact_id + "◆" + fact_name;elseallquery_str = allquery_str + "|" + fact_id
+ "◆" + fact_name;// 为后边查询做准备 all_factory = all_factory + "<OPTION value="
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询