<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function Send() {
alert("开始进行提交操作")
}
function Close() {
window.close();
alert("提交完关闭当前窗口") }
</script>
</head>
<body>
<form target="_blank" action="http://www.csdn.net" onsubmit="Send();Close();">
<input type="submit" value="提交" />
</form>
</body>
</html>如上面代码,因为我现在要做一个支付页面,而我的页面是在iframe里面的,
如果在iframe里面进行post到alipay的话,会出错,所以这时post就得加上 target="_blank"
但加上_blank的时候就是在新窗口,但当前客户下单的页面就没有半闭
如上我的写法是错误的,那正确的写法应该是怎么样谢谢
解决方案 »
- ckediter+ckfinder windows可以上传,lunix就是不行
- jquery对oninput onpropertychange不支持怎么办?
- jquery一个问题,请教
- 求助:如何实现把一个select里的选项添加到另一个空的select里。
- 我想写一个blog,麻烦大神交我怎么写?
- XML读取某一个片段的循环求助
- 一个超难的打印问题,希望高手指点,解决立即送分,更多的是感谢!!!!
- 两个name相同的radio,怎样单击时判断是哪个被单击??
- 如何让提交产生的窗口,限制高和宽?
- 如何使鼠标移到某个表格上,其背景色改变?
- opera下mouseover事件div边框显示不完全!
- 在一个费时的js循环前在ie里打出“请稍候...”的div,如何让浏览器得到刷新机会以真正显示此div?
<form target="_top" action="http://www.csdn.net">
<input type="submit" value="提交" />
</form>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>text</title>
<script>
function checkLeave(){
alert("提交完关闭当前窗口");
}
</script>
</head>
<body onunload="checkLeave()">
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function Send() {
alert("开始进行提交操作")
window.close();
}
function Close() { }
</script>
</head>
<body>
<form target="_blank" action="http://www.csdn.net" onsubmit="Send()">
<input type="submit" value="提交" />
</form>
</body>
</html>
代码在Firefox中不通过,没有关闭窗口
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript">
function Send() {
alert("开始进行提交操作")
}
function Close() {
window.close();
} function doSubmit(fn){
var frm = document.getElementById("frm");
frm.submit();
fn();
}
</script>
</head>
<body onload="init()">
<form id="frm" target="_blank" action="http://www.csdn.net">
<input type="button" value="提交" onclick="doSubmit(Close)"/>
</form>
</body></html>
找到dom.allow_scripts_to_close_windows这项并改为true。