首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

jsp中js代码没有执行. 不知道原因解决方案

2012-03-30 
jsp中js代码没有执行. 不知道原因script typetext/javascriptalert(a)fuction show(){%IProDAO d

jsp中js代码没有执行. 不知道原因
<script type="text/javascript">
alert("a");
fuction show(){
<%
IProDAO dao = new ProDAOImpl();
String strId = request.getParameter("id"); 
int tid = strId!=null?Integer.parseInt(strId):1;
Product p = dao.getProductById(tid);
int id = p.getId();String name = p.getName();
String guige = p.getGuiGe();int num = p.getNum();
double price = p.getPrice(); 
String factory = p.getFactory();
%>
alert("name");
document.getElementById("name").value = <%=name%>
document.getElementById("guige")value = <%=guige%>
document.getElementById("num")value = <%=num%>
document.getElementById("factory").value = <%=factory%>
}
  </script>


  <body onload="show()">
  在jsp里面 没有给文本框赋值

  重写URL时候 <a href = "update.jsp?id="+<%=p.getId() %>> 在那边页面没有接受到值得...也不知道为什么 


[解决办法]

探讨
拼写错误:

fuction show(){
修改为
function show(){

热点排行