unknow runtime error,求救

jin75hong 2008-10-14 09:02:13
AJAX提交时,提示说 unknow runtime error 错误信息,求救啊


把我的代码发上来:
<%@ page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.lang.*" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<%
Object ob=session.getAttribute("id");
if(ob==null)
{

response.sendRedirect("/wdl.html");

}
else
{
String id=ob.toString();
%>
<jsp:useBean id="lr" class="bean.query" scope="page" />

<%
String sql="select user_info.user_id from user_info,role,action_mapping,action_special where (user_info.user_role=role.role_id and role.role_id=action_mapping.role_id and action_mapping.action_id='G102'and user_info.user_id='"+id+"') or (user_info.user_id=action_special.user_id and action_special.action_id='G102'and user_info.user_id='"+id+"')";
ResultSet rs=lr.getconnection(sql);
if(!rs.next())
{
response.sendRedirect("/wqx.html");
}
rs.close();
lr.close();
}
%>
<jsp:include page="date.js"> </jsp:include>
<title>论文/会议录入 </title>


<style type="text/css">
<!--
.STYLE2 {color: #FF0000}
.STYLE3 {font-size: 18px}
-->
</style>

<script type="text/javascript">
var xmlHttp; //用于保存XMLHttpRequest对象的全局变量

//用于创建XMLHttpRequest对象
function createXmlHttp()
{
//根据window.XMLHttpRequest对象是否存在使用不同的创建方式
if (window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest(); //FireFox、Opera等浏览器支持的创建方式
}
else
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");//IE浏览器支持的创建方式
}
}
function vote()
{
var t=document.getElementById("typ").value;
try
{
createXmlHttp(); //创建XmlHttpRequest对象
xmlHttp.open("POST", "ajax_lrlunwen.jsp?ty="+t, true);
xmlHttp.send(null);
xmlHttp.onreadystatechange = showRating; //设置回调函数
}
catch(e)
{
alert("11");
}
}

function showRating() {

if (xmlHttp.readyState == 4)
{

document.getElementById("form1").innerHTML =xmlHttp.responseText;
}
else
{

}
}
</script>

<body>


<table width="677" border="1" align="center">
<tr>
<td height="34" colspan="3" align="center" background="img/23.bmp"> <h2> <span class="STYLE3">教师论文/会议信息录入 </span> </h2> </td>
</tr>
<tr>
<td height="163" colspan="2">

请选择录入的类型: <select name="typ" id="typ">
<option value="01">会议 </option>
<option value="02">论文 </option>
</select>
   <input type="button" id="btn1" name="btn1" value="确认" onClick="vote()"> <br>
</td>
</tr>
<tr>
<td>
<form action="tj_lrxiangmu.jsp" name="form1" method="post" id="form1" >
<input type="hidden" name="ty" value="document.getElementById("typ").value">
</form>
</td>
</tr>
</table>
<p>  </p>


</body>
</html>


<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档 </title>
<jsp:include page="date.js"> </jsp:include>
</head>
<jsp:useBean id="jb" class="bean.query" scope="page"> </jsp:useBean>
<body>
<%
String typ=request.getParameter("ty");
if(typ.equals("01"))
{
%>
<form method="post" name="form1" id="form1" action="tj_lrlunwen.jsp">
<table border="0" align="center">
<tr> <td>会议编号: </td> <td> <input type="text" name="id" /> </td> </tr>
<tr> <td>会议名称: </td> <td> <input type="text" name="title" /> </td> </tr>
<tr> <td>会议标题: </td> <td> <input type="text" name="fu_title" /> </td> </tr>
<tr> <td>会议主办单位: </td> <td> <input type="text" name="danwei" /> </td>
<tr> <td>会议时间: </td> <td> <input type="text" name="sj" onClick="setday(this)"/> </td> </tr>
<tr> <td>论文级别: </td>
<td> <select name="jb">

<%
String s1="select id,jibie from t_level";
ResultSet r1=jb.getconnection(s1);
while(r1.next())
{
%>
<option value=' <%=r1.getString("id") %>'> <%=r1.getString("jibie") %>
<%
}

jb.close();
%>
</select>
</td> </tr>

</table>
</form>
<%
}
else if(typ.equals("02"))
{
%>
020202
<%
}
else
{
%>
错误!
<%
}
%>
</body>
</html>


选择 "会议"时出现 unknow runtime error,选择"论文" 时就没问题啊
...全文
184 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
jin75hong 2008-10-16
  • 打赏
  • 举报
回复
为什么没人帮我啊.......
jin75hong 2008-10-15
  • 打赏
  • 举报
回复
没用,看来不是这里有问题
jin75hong 2008-10-15
  • 打赏
  • 举报
回复
不是这个问题啊,我把那条语句删了,还是那个错误
zjc_love 2008-10-15
  • 打赏
  • 举报
回复
var t=document.getElementById("typ").value;

这样获得的始终是第一个的值吧
var t= document.getElementById("typ");
var text=t.options[t.selectedIndex].text;
value应该一样
jin75hong 2008-10-15
  • 打赏
  • 举报
回复
请大家给点意见.....
yami251139 2008-10-14
  • 打赏
  • 举报
回复
var t=document.getElementById("typ")[i].value;
可能是这样写。。。
反正是后面要加个变量
你查下吧

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧