JS和JAVA传值问题 本帖最后由 shixiaotuo 于 2011-07-28 13:11:23 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script type="text/javascript"> function extra(id,panel,title,url){<%pageContext.setAttribute("temp",panel); %>}</script> panel,是从JS里面获得的值,1楼这样好像不行..panel值取不到了 jsp中java代码和js代码混合使用 和jsp中赋变量值一个道理 <%pageContext.setAttribute("temp",'"+panel+"'); %>这样试试 楼主还是写在一个隐藏域里,然后提交到后台存这个值吧js没法直接给java赋值<input type="hidden" name="temp" value="2b"/>function extra(id,panel,title,url){document.getElementById("temp").value = panel;}后台这么写String panel = request.getParameter("temp");pageContext.setAttribute("temp",panel); 如何为我指定的标签绑定onkeyup事件,处理函数已经写好 JS的时间格式化 各位各位, Look Here! 请帮帮忙哦!! 如何获得指定层中所有的图像高宽?? javascript 如何得到服务端 CGI 程序的返回 jquery 替换指定内容 年月日联动,为何每年2月份的日期显示不出来,其他月份是正常的 swf文件下载后不能打开 怎样模式打开一窗口,处理完asp的一段代码后再关闭窗口,并刷新父窗口? 一个关于showModelessDialog的问题 JS如何得出两个日期之间的周数目? 求一JS效果
function extra(id,panel,title,url)
{
<%pageContext.setAttribute("temp",panel); %>
}</script>
楼主还是写在一个隐藏域里,然后提交到后台存这个值吧
js没法直接给java赋值<input type="hidden" name="temp" value="2b"/>function extra(id,panel,title,url)
{
document.getElementById("temp").value = panel;
}后台这么写
String panel = request.getParameter("temp");
pageContext.setAttribute("temp",panel);