<script type="text/javascript">
var cha = 10;
function chongChouQu() {
window.location = "suiJi.action";
}
function checkChecked() {
var ipts = document.getElementById('tableid').getElementsByTagName('input'), checked = 0, notchecked = 0;
for(var i=0;i<ipts.length;i++)
if (ipts[i].type == 'checkbox') {
ipts[i].checked ? checked++ : notchecked++;
}
if(notchecked>0){
alert('没有全部选中,无法保存');
cha = notchecked;
return false;
}else{
window.location="addExtract.action";
}
}
</script>
一段代码,怎么把cha这个值通过chongChouQu()方法传递到window.location = "suiJi.action";还有就是如果我在action中定义一个private integer cha=null并生成get;set方法,能接收到前台的这个值
你用的什么语言?你的Action用的是什么框架呢?我知道java的值传递流程,struts2可以实现你说的功能的。
window.location = "suiJi.action?cha="+cha;
问号传值?paramName=value
struts2可以实现你说的功能的
window.location = "suiJi.action?cha="+cha;问号传值?paramName=value