1.table 删除行
function doDel(obj){
while(obj.tagName.toLowerCase() != "tr"){
obj = obj.parentNode;
}
obj.parentNode.removeChild(obj);
}
2.jsp动作获取table中所在的行数
function doSelected(e){
e=e|| window.event;
var obj=e.target || e.srcElement;
if(obj.tagName.toUpperCase()=="TD"){
obj=obj.parentNode;
}
var num = obj.rowIndex;
}
3.window.showModalDialog和window.open
火狐浏览器不兼容window.showModalDialog的父页面传值
window.showModalDialog("/huichen/pages/common/Cmn001/Cmn00101.jsp?perId="+perId,window,"dialogWidth=500px;dialogHeight=300px;status: no");
给父页面传值:window.dialogArguments.document.getElementById("");
var wid = screen.width/2;
var hei = screen.height/2;
var popwin = window.open("pages/common/Cmn001/oldManquery!init.action?queryBean.userId="+perId,"window","width="+wid+",height="+hei+",status=no,scrollbars=yes");
popwin.moveTo(screen.width/4,screen.height/4);
给父页面传值:window.opener.document.getElementById("");
4.js获取Action传递对象或者List对象
Action中:
JSONArray ja = JSONArray.fromObject(dataList); dataList--List对象
dataListStr = ja.toString().replaceAll("\"", "'"); dataListStr--返回页面表单属性或session对象
js中:
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载