javascript备忘
1.刷新页面
window.location.reload();
链接到:window.location.href="RelationIndividual_Info.aspx?CustomerID=1234" ;
window.open("url","_blank");是打开新窗口
window.location.href=url;是本地窗口装载URL的网页
//弹出模式对话框
var iWidth="860px";
var iHeight="620px";
var retval = window.showModalDialog(IPATH + url,'son','dialogwidth:'+iWidth+'px;dialogheight:'+iHeight+'px;help:no;status:no;scroll:directories:no;scrollbars:no;Resizable=no;')
//弹出无模式对话框
//var iWidth=830;
//var iHeight=600
//window.open(url, "NewWindows", "Width="+iWidth+",Height="+iHeight+",Left=" + (screen.width-iWidth)/2 + ",Top=" +(screen.height-iHeight)/2 + ",fullscreen=no,location=no,status=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes");
2.iframe中,调用子页面的函数
父页中嵌入子页面: <iframe id="f5" frameborder="0" src="RelationIndividual_Info.aspx"></iframe>
父页中调用子页面的函数 f5.childfunction();
3.escape 和 unescape
4.判断回车
onkeypress="func();"
function func()
{
if(event.keyCode==13)
{
}
}
5.回退
history.go(-1)