首页 > iframe 跨域提交的问题

iframe 跨域提交的问题

在a.domain.com下a.html

<html>
<head>
</head>
<body>
<div id="p"></div>
</body>
</html>

然后用js动态生成

p.innerHTML = '<iframe width="400" height="400" marginWidth=0 marginHeight=0 frameBorder=0 width="100%" scrolling="no" allowTransparency="true" src="b.domain.com/b.html"></iframe>'

b.html

<form id="form1" name="form1" target="login_ifr" action="c.domain.com/c.php" method="POST">
......
</form>
<iframe id="login_ifr" name="login_ifr" src="" width="0" height="0" frameborder="0" scrolling="no" style="display:none;"></iframe>

上面是主要的几个文件,在a.html里有个按钮,当user点击按钮后弹出层b.html,然后用户在弹出层里输入信息点提交后,b.html中的form提交到c.domain.com下的c.php进行逻辑处理,form的target为b.html的一个隐藏iframe。现在除了IE6外的浏览器都可以运行成功,就是在IE6下报错“拒绝访问”

这个错误目前发现是在安装有360软件的机子上出现的几率大些,我如果把http://*.domain.com加入为信任站点,就不报错了,程序执行成功。但你不能让用户去添加信任站点呀,帮忙分析一下是哪里的问题。


抛弃IE6的用户吧

【热门文章】
【热门文章】