JS知识点(二):父页面的url拼接随机数用于处理IE8重复提交表单的的问题

// 关闭当前窗口并刷新父页面
		function closeWindow() {
			if(window.opener){
				if(window.opener.document.forms[0]){
					//父页面的url拼接随机数用于处理IE8重复提交表单的的问题
					var openerAction = window.opener.document.forms[0].action;
					if(openerAction.indexOf('?')!=-1){
						openerAction+="&repeatSubmitRound="+Math.round(Math.random()*100000);
					}else{
						openerAction+="?repeatSubmitRound="+Math.round(Math.random()*100000);
					}
					window.opener.document.forms[0].action = openerAction;
					window.opener.document.forms[0].submit();
				}else{
					window.opener.location.reload(); 
				}
			}
			window.close();
		}

猜你喜欢

转载自blog.csdn.net/zy123698745/article/details/90238511