javascript对表格的操作:
function addTr()
{
var table = document.getElementById("apntable");
var lastTr = table.firstChild.lastChild;
if(lastTr.id == "lastLineStyleTr") {
lastTr.parentNode.removeChild(lastTr);
}
var input1 = document.createElement("input");
var row1 = table.insertRow(-1);
var row1_cell1 = row1.insertCell(-1);
row1_cell1.className = "tdlineleft";
row1_cell1.innerHTML = "<input id='apnname' name='apnname' size='6'></input>";
table.firstChild.appendChild(lastTr);//table有个隐藏的属性<tbody>所以要在table加入一行应该table.firstChild.appendChild(row)
i++;
}
window.open居中:
function changepassword(url,height,width)
{
screenX = window.screen.width;
screenY = window.screen.height;
var x = (screenX-width)/2;
var y = (screenY-height)/2;
window.open(url,null,"menubar:no,status:no,height:"+height+",width:"+width+",top="+y+",left="+x);
}
对于页面登录界面居中:
function showPosition() {
var windowHeight = document.body.offsetHeight;
var windowWidth = document.body.offsetWidth;
var loginDialog = document.getElementById("loginDialog");
var login = document.getElementById("login");
var loginHeight = login.offsetHeight;
var loginWidth = login.offsetWidth;
loginDialog.style.paddingLeft = (windowWidth - loginWidth)/2;
loginDialog.style.paddingTop = (windowHeight - loginHeight) / 3;
window.onresize = showPosition;
}
function addTr()
{
var table = document.getElementById("apntable");
var lastTr = table.firstChild.lastChild;
if(lastTr.id == "lastLineStyleTr") {
lastTr.parentNode.removeChild(lastTr);
}
var input1 = document.createElement("input");
var row1 = table.insertRow(-1);
var row1_cell1 = row1.insertCell(-1);
row1_cell1.className = "tdlineleft";
row1_cell1.innerHTML = "<input id='apnname' name='apnname' size='6'></input>";
table.firstChild.appendChild(lastTr);//table有个隐藏的属性<tbody>所以要在table加入一行应该table.firstChild.appendChild(row)
i++;
}
window.open居中:
function changepassword(url,height,width)
{
screenX = window.screen.width;
screenY = window.screen.height;
var x = (screenX-width)/2;
var y = (screenY-height)/2;
window.open(url,null,"menubar:no,status:no,height:"+height+",width:"+width+",top="+y+",left="+x);
}
对于页面登录界面居中:
function showPosition() {
var windowHeight = document.body.offsetHeight;
var windowWidth = document.body.offsetWidth;
var loginDialog = document.getElementById("loginDialog");
var login = document.getElementById("login");
var loginHeight = login.offsetHeight;
var loginWidth = login.offsetWidth;
loginDialog.style.paddingLeft = (windowWidth - loginWidth)/2;
loginDialog.style.paddingTop = (windowHeight - loginHeight) / 3;
window.onresize = showPosition;
}