(IE7)关于ModalDialog页面内的表单在本窗口中提交的问题 在IE6底下,我们加上<base target="_self"/>一般就可以实现在本窗口中提交,点击页面上的link也会在本窗口跳转。但是在用IE7的情况,还是会打开一个新页面。请教一下这时候该如何处理。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 JKHtml里有对这个问题进行讨论处理:JKHtml\问题收集(csdn)\Dialog里弹出新窗口的解决\test.htm下载地址http://download.csdn.net/source/276201test.htm:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title> JK:支持民族工业,尽量少买X货 </title> <script language=javascript srcccccc="CommonJSFunction.js"> /** * This function is to submit a form to ModalDialog. * JK 2007-03-06 */ function submitToModalDialog(formObj,dialogTitle,sFeatures){ var dialogArguments=new Array(); dialogArguments["src"]=null; dialogArguments["title"]=dialogTitle; dialogArguments["form"]=formObj; return showModalDialog("DialogFrame.htm",dialogArguments,sFeatures); } </script> </head> <body> <form name="frm0" action="test.htm" > <input type=button value=DialogFrame onclick="var a=new Array();a['src']='test.htm';window.showModalDialog('DialogFrame.htm',a);"/> <br/> <input name=q> <input type=button value=DialogFrame onclick="submitToModalDialog(this.form,'JK','');"/> <br/> <a href="http://jkisjk.spaces.live.com">http://jkisjk.spaces.live.com</a> <br/> </form> <hr/> </body> </html> ---------------------------- DialogFrame.htm本页面解决的问题1。IE设置检查更新为"自动"时dialog里的信息是旧数据2。dialog里location.href=url导致新开窗口 (另外一个解决办法是dialog里的所有页面加<base target="_self"/>)3。支持submitToModalDialog<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <script language=javascript> var DialogArgument=window.dialogArguments; //The following code exists for :IE 6 can not change dialog title. if (DialogArgument && DialogArgument.title) document.write(" <title>"+DialogArgument.title+" </title>"); else document.write(" <title> Dialog </title>"); </script> </head> <body leftMargin=0 rightMargin=0 topMargin=0 bottomMargin=0 onload="initFun();" scroll=no><iframe name="dialogFrame" src="blank.html" width=100% height=100% id=dialogIframe> </iframe> <form name="dialogForm" method="post" action="" target="dialogFrame" style="display:onne;"> </form> </body> </html> <script language=javascript> function initFun() { if (DialogArgument!=null){ if(DialogArgument.form!=null){ var argForm=DialogArgument.form; var tempForm=document.dialogForm; tempForm.action=argForm.action; var argFormElements=argForm.elements; for(var i=0;i <argFormElements.length;i++){ tempForm.insertAdjacentHTML("beforeEnd",argFormElements[i].outerHTML); } tempForm.submit(); } else{ document.dialogForm.action=DialogArgument.src; document.dialogForm.submit(); } } else alert("useDialogFrameWrongly"); } </script> jsp中的怎么打印特定的隐藏内容? JS有C中读入内存的概念么?即缓存。 求页面全屏代码,或者去掉地址栏等代码,不能用 Window.open 能帮我解决下这个问题吗??急~!~!急~!~! javascript的一种语法 散发了,欢迎大家测试用Ext2.0做的网站! 静态态显示动态页的图片如何实现. Ext4.0叶子节点事件响应 怎样分割单元格呢?(合适答案马上结贴) 如何清空iframe中的内容? javascript 的问题 高手帮忙 请问这个写法可行不 alert( '<?php echo $table_id?>' );
JKHtml\问题收集(csdn)\Dialog里弹出新窗口的解决\test.htm
下载地址
http://download.csdn.net/source/276201test.htm:<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title> JK:支持民族工业,尽量少买X货 </title>
<script language=javascript srcccccc="CommonJSFunction.js">
/**
* This function is to submit a form to ModalDialog.
* JK 2007-03-06
*/
function submitToModalDialog(formObj,dialogTitle,sFeatures){
var dialogArguments=new Array();
dialogArguments["src"]=null;
dialogArguments["title"]=dialogTitle;
dialogArguments["form"]=formObj;
return showModalDialog("DialogFrame.htm",dialogArguments,sFeatures);
}
</script>
</head>
<body>
<form name="frm0" action="test.htm" >
<input type=button value=DialogFrame onclick="var a=new
Array();a['src']='test.htm';window.showModalDialog('DialogFrame.htm',a);"/> <br/>
<input name=q> <input type=button value=DialogFrame onclick="submitToModalDialog(this.form,'JK','');"/> <br/>
<a href="http://jkisjk.spaces.live.com">http://jkisjk.spaces.live.com</a> <br/>
</form>
<hr/>
</body>
</html> ---------------------------- DialogFrame.htm
本页面解决的问题
1。IE设置检查更新为"自动"时dialog里的信息是旧数据
2。dialog里location.href=url导致新开窗口 (另外一个解决办法是dialog里的所有页面加<base target="_self"/>)
3。支持submitToModalDialog<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=javascript>
var DialogArgument=window.dialogArguments;
//The following code exists for :IE 6 can not change dialog title.
if (DialogArgument && DialogArgument.title) document.write(" <title>"+DialogArgument.title+" </title>");
else document.write(" <title> Dialog </title>");
</script>
</head>
<body leftMargin=0 rightMargin=0 topMargin=0 bottomMargin=0 onload="initFun();" scroll=no>
<iframe name="dialogFrame" src="blank.html" width=100% height=100% id=dialogIframe> </iframe>
<form name="dialogForm" method="post" action="" target="dialogFrame" style="display:onne;">
</form>
</body>
</html>
<script language=javascript>
function initFun()
{
if (DialogArgument!=null){
if(DialogArgument.form!=null){
var argForm=DialogArgument.form;
var tempForm=document.dialogForm;
tempForm.action=argForm.action;
var argFormElements=argForm.elements;
for(var i=0;i <argFormElements.length;i++){
tempForm.insertAdjacentHTML("beforeEnd",argFormElements[i].outerHTML);
}
tempForm.submit();
}
else{
document.dialogForm.action=DialogArgument.src;
document.dialogForm.submit();
}
}
else alert("useDialogFrameWrongly");
}
</script>