Note Versions of Internet Explorer prior to Windows Internet Explorer 7 would allow the base element to appear anywhere in the document tree, which caused relative paths to use the "nearest" base element as the base for the URL. Internet Explorer 7 strictly enforces the use of the base tag within the head of the document, and will ignore misplaced tags.在IE7之前的版本中base元素允许出现在文档的任何地方. 并且一最近的一个元素发挥作用. 但IE7强制base标签必须出现在head标签中间.这个是msdn的解释 不知道有没有用
<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="a.jsp">
<input type=button value =DialogFrame onclick="var a=new Array();a['src']='a.jsp';window.showModalDialog('DialogFrame.htm',a);"/><br/>
<input name=q><input type=button value =DialogFrame onclick="submitToModalDialog(this.form,'JK','');"/><br/>
</form>
<hr/>
</body></html>----------------------------Dialog frame
<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!=null) document.write("<title>"+DialogArgument.title+"</title>");
else document.write("<title>Dialog</title>");
</script>
<title>Dialog</title>
</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("useDialogFrameWrong");
}
</script>
模态框里打开新的链接肯定会弹出新的窗口的,除非用SUBMIT递交页面跳转到别的页面里~
但IE7强制base标签必须出现在head标签中间.这个是msdn的解释 不知道有没有用
<title>标题</title>
<base target="_self"/>
...
</head>
否则就不会有效。切记切记!