我在javaScript中定义了
var height=window.screen.height;
var width=window.screen.width;
var height=window.screen.height;
var width=window.screen.width;
解决方案 »
- web.xml配置问题,在线等,急急........
- 公司让做一个网上购物的网站,知道点的来说说看看
- Struts2自定义拦截器中怎样添加出错信息?
- 发两个在线编辑器带图片上传forjava
- 急.........关于模拟http请求的问题
- JSP连接SQL SERVER 2000的问题。(恳请大家看看)谢谢!
- jsp出错了,急,急,急,急,在线等!!!
- 不配odbc,能不能连接数据库?
- Java,jsp, javascriplets三者有什么区别?
- 关于JS中outlookbar.additem的一个问题
- 大家进来帮分析一下java.lang.IndexOutOfBoundsException: Index: 0, Size: 0什么错误?
- java可以模拟一个ip地址,然后进行http请求抓取页面吗?
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>大概就这样提交
<!--
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);%>
老大。帮忙啊~~速度啊~~
解决了。马上给分
window.open (文件名.jsp?height=高度&width=宽度);
}只是写的伪代码 注意一下js的格式,别的没什么其实方法有好多或者是你在提交时设一个action,写个专门给input赋值的语句
document.forms[0].screenheight.value = window.screen.height;最后再用document.form.submit();提交
<input type="hidden" id="screenwidth" value="">
改成
<input type="hidden" name="screenheight" value="">
<input type="hidden" name="screenwidth" value="">传的值只能收到name,id收不到.