为什么?在ie5中提交表单时,提交到一个iframe中时,却在新窗口打开. 如果是target=iframeName的话没有问题的,如果改name的iframe找不到会在新窗口打开的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在新窗口打开. 肯定 target 错了 <form name = form1 target=framename></form><iframe name = framenaem> 假设你的iframe如下:<iframe name = content>在你要提交的页上加上下面这句话<base target="content"> 是这样写的吗?<form target="win"><input type=submit></form><iframe name="win"></iframe> 这是代码:<div id='show_text'></div><form name='form1' enctype='multipart/form-data' method='post' action='file_upload.php?dir=logos' target=file_upload_iframe><input type='file' name='img'><br><input type=submit value=下一步><br><img name=show_img src='../../../.././forum/images/system/icons.gif' style='display:none'><br><div id=show_swf style='display:none'></div></form><iframe id=file_upload_iframe name=file_upload_iframe style='width:0;height:0'></iframe><script language=javascript> //读取扩展名 function readEx(s) { var s = s.split('\\'); s = s[s.length-1]; s = s.split('.'); s = s[s.length-1]; return s; } function show(value) { if (document.all.img.value != '') { var ex = readEx(document.all.img.value) if (/bmp/i.test(ex) || /jpg/i.test(ex) || /gif/i.test(ex) || /png/i.test(ex)) { document.all.show_img.src = document.all.img.value; document.all.show_img.style.display = ''; document.all.show_swf.style.display = 'none'; } else if (/swf/i.test(ex)) { if (value != document.all.img.value) { value = document.all.img.value; value = value.replace(/\\/g, '\\\\'); document.all.show_swf.innerHTML ='<embed id=swf_show src='+document.all.img.value+' height=320 width=240>'; document.all.show_swf.style.display = ''; document.all.show_img.style.display = 'none'; } else { value = value.replace(/\\/g, '\\\\'); } } else { document.all.show_swf.style.display = 'none'; document.all.show_img.style.display = 'none'; } } setTimeout('show("'+value+'")', 500); } show(document.all.img.value); </script><script>window.open(self.location);</script> 给iframe一个name,给form一个target,2者相同就可以了 我的代码是在一个用showModalDialog打开的弹出对话框中,在ie6下正常,而在ie5下却弹出新窗口.请问如何解决. 将IFRAME放在打开showModalDialog的窗口中,而不要放在这个提交窗口中. 这个问题小弟也不会呀,请各位仁兄指点一下!!!!!!http://expert.csdn.net/Expert/topic/1948/1948696.xml?temp=.4253046谢谢了。。 继续用showModalDialog打开弹出的窗口<script>function checkform(){ url = "file_upload.php?dir=logos&xx=xx&xx=xx"; showModalDialog(url,window,'dialogwidth=;dialogheight='); window.close();}</script><form name='form1' enctype='multipart/form-data' method='post' onsubmit=checkform()> javascript:history.go(-1)跳回上一页为啥还弹出框啊 100分求IE内存释放方法 关于function的问题 如何有效修改Hta显示的Icon图标和Hta标题栏状态栏图标 javascript实现工龄工资计算问题 在jsp和htm之间相互传递参数的问题 歌词同步播放:支持火狐和ie 那位大哥有js写的锁定主页修改代码?(用在正途) 浮动的图层总是被其它图层覆盖(加急) 这种方式要如何才能躲过3721那些拦截。 请问showModalDialog()函数show出来的页面能交互吗??? 有一个javascript的问题,请高手指点!谢谢!
</form>
<iframe name = framenaem>
<iframe name = content>
在你要提交的页上加上下面这句话
<base target="content">
<form target="win">
<input type=submit>
</form>
<iframe name="win"></iframe>
<div id='show_text'></div><form name='form1' enctype='multipart/form-data' method='post' action='file_upload.php?dir=logos' target=file_upload_iframe><input type='file' name='img'><br><input type=submit value=下一步><br><img name=show_img src='../../../.././forum/images/system/icons.gif' style='display:none'><br><div id=show_swf style='display:none'></div></form>
<iframe id=file_upload_iframe name=file_upload_iframe style='width:0;height:0'></iframe><script language=javascript>
//读取扩展名
function readEx(s)
{
var s = s.split('\\');
s = s[s.length-1];
s = s.split('.');
s = s[s.length-1];
return s;
}
function show(value)
{
if (document.all.img.value != '') {
var ex = readEx(document.all.img.value)
if (/bmp/i.test(ex) || /jpg/i.test(ex) || /gif/i.test(ex) || /png/i.test(ex)) {
document.all.show_img.src = document.all.img.value;
document.all.show_img.style.display = '';
document.all.show_swf.style.display = 'none';
} else if (/swf/i.test(ex)) {
if (value != document.all.img.value) {
value = document.all.img.value;
value = value.replace(/\\/g, '\\\\');
document.all.show_swf.innerHTML ='<embed id=swf_show src='+document.all.img.value+' height=320 width=240>';
document.all.show_swf.style.display = '';
document.all.show_img.style.display = 'none';
} else {
value = value.replace(/\\/g, '\\\\');
}
} else {
document.all.show_swf.style.display = 'none';
document.all.show_img.style.display = 'none';
}
}
setTimeout('show("'+value+'")', 500);
}
show(document.all.img.value);
</script><script>window.open(self.location);</script>
弹出新窗口.
请问如何解决.
http://expert.csdn.net/Expert/topic/1948/1948696.xml?temp=.4253046
谢谢了。。
<script>
function checkform()
{
url = "file_upload.php?dir=logos&xx=xx&xx=xx";
showModalDialog(url,window,'dialogwidth=;dialogheight=');
window.close();
}
</script>
<form name='form1' enctype='multipart/form-data' method='post' onsubmit=checkform()>