我在javaScript中定义了
var height=window.screen.height;
var width=window.screen.width;

解决方案 »

  1.   

    <script>
    function test() {
      document.forms[0].screenheight.value = window.screen.height;
      document.forms[0].screenwidth.value = window.screen.width;
    }
    </script>
    <body onload="test()">
    <form action="upscreen.do">
    <input type="hidden" id="screenheight" value="">
    <input type="hidden" id="screenwidth" value="">
    </form>大概就这样提交
      

  2.   

    按理说,应该可以啊~~怎么提交后得到的是空值啊~~~~<script>
    <!--
    function test() {
      document.forms[0].screenheight.value = window.screen.height;
      document.forms[0].screenwidth.value = window.screen.width;
    }
     //-->
    </script>
    <body onload="test()">
    <form action="test.jsp" >
    <input type="hidden" id="screenheight" value="">
    <input type="hidden" id="screenwidth" value="">
    <INPUT TYPE="submit">
    </form>
    test.jsp<%
    String screenheight=request.getParameter("screenheight");
    String screenwidth=request.getParameter("screenwidth");
    out.println(screenheight);
    out.println(screenwidth);%>
    老大。帮忙啊~~速度啊~~
    解决了。马上给分
      

  3.   

    function test() {
    window.open (文件名.jsp?height=高度&width=宽度);
    }只是写的伪代码 注意一下js的格式,别的没什么其实方法有好多或者是你在提交时设一个action,写个专门给input赋值的语句
    document.forms[0].screenheight.value = window.screen.height;最后再用document.form.submit();提交
      

  4.   

    把value取掉看看<input type="hidden" id="screenheight">
      

  5.   

    <input type="hidden" id="screenheight" value="">
    <input type="hidden" id="screenwidth" value="">
    改成
    <input type="hidden" name="screenheight" value="">
    <input type="hidden" name="screenwidth" value="">传的值只能收到name,id收不到.
      

  6.   

    呵呵~~在自己原来的代码里用的是 name,不是id结果还是显示空值,把Tomcat重启也没用最后重启电脑才不会显示空值,呵呵~~在这里谢谢大家的帮助~~~~