如何在javaScript中使用jsp代码中定义的变量???
<%
int id=Integer.parseInt(request.getParameter("id"));
//String id=request.getParameter("id");
String query="select * from v_publish where id="+id;
ResultSet rs=dbBean.executeQuery(query);
String book_name="";
String book_type="";
if(rs.next())
{
book_name=rs.getString("book_name");
if(book_name==null) book_name="";
book_type=rs.getString("book_type");
if(book_type==null) book_type="";
} }
rs.close();
%>
<script language="javascript">
function InitForm(){
document.add.book_type.value=??; //想在这里用上面定义的book_type
}
</script>
求各位大侠予以指教!!!
int id=Integer.parseInt(request.getParameter("id"));
//String id=request.getParameter("id");
String query="select * from v_publish where id="+id;
ResultSet rs=dbBean.executeQuery(query);
String book_name="";
String book_type="";
if(rs.next())
{
book_name=rs.getString("book_name");
if(book_name==null) book_name="";
book_type=rs.getString("book_type");
if(book_type==null) book_type="";
} }
rs.close();
%>
<script language="javascript">
function InitForm(){
document.add.book_type.value=??; //想在这里用上面定义的book_type
}
</script>
求各位大侠予以指教!!!
...全文
相关推荐
js代码高亮显示 JavaScript代码高亮 jsp
js代码高亮显示 JavaScript代码高亮 jsp js代码高亮显示 JavaScript代码高亮 jsp
在JS中如何调用JSP中的变量
在JS中调用JSP中的变量: 代码如下: <% int coblid=Integer.parseInt(request.getParameter(“blid”)); %> [removed] var coblid='<%=coblid%>’ ; [removed]
JSP中java代码与js之间的传值
NULL 博文链接:https://wuaner.iteye.com/blog/455481
jsp/javascript打印九九乘法表代码
编程打印九九乘法表,本文介绍两种实现方式:jsp表达式方式javascript方式,可以根据自己的习惯随意选择,感兴趣的朋友可以参考下哈
jsp,js,javascript,java代码格式化工具
可以对一个,或则多个jsp,js,javascript,java文件源代码格式化工具,其中jsp文件,内可以含,javascript,vbscript等,都能格式化,有问题联系gisoracle@126.com 使用C#开发,请安装.net2.0


Web 开发
