userno = prompt('请输入用户名:','');这样能弹出一个输入框,可是输入框中的值我怎么能够得到进一步处理???谢谢!!!我的代码如下:
<%
  String userno = request.getUser();
%>
<script>
  if(userno == null){
    userno = prompt('请输入用户名:','');
  }
</script>
<%
  //这里我要用输入的用户名进行处理,请问各位高手我怎么得到userno的值?
%>

解决方案 »

  1.   


    userno = prompt('请输入用户名:','');
    userno不就是了吗
      

  2.   

    在<script>里当然能得到了!问题是我想在程序里使用userno这个变量,在<% %>里能用吗???
      

  3.   

    在<script>里当然能得到了!问题是我想在程序里使用userno这个变量,在<% %>里能用吗???
    这个问题也曾经困惑我很久。不要这样想,肯定是不能得到的。你想想scriplet的机制就会明白了,页面级的互动只能用script来实现。
      

  4.   

    --------------------------------------
    doModal("User.jsp?id=1", this, 150, 180);
    --------------------------------------// Display a new window dialog
    // Param:  url the url
    // MyWindow the window object
    // mwidth the width of window
    // mheight  the height of window
    function doModal(url,MyWindow,mwidth,mheight)
    {
    var newWindow; if (document.all&&window.print) //if ie5
    newWindow = window.showModelessDialog(url,MyWindow,"help:0;resizable:1;dialogWidth:"+mwidth+"px;dialogHeight:"+mheight+"px;status:no");
    else
    newWindow = window.open(url,"","width="+mwidth+"px,height="+mheight+"px,resizable=1,scrollbars=1"); newWindow.name = "NewWindow"; return newWindow;
    }
    -------------------------------------------------------------------------
    大家参考一下,共同提高自己的编码水平!