iframe中的iframe问题

时间:2009-03-28 08:30:19

标签: jquery internet-explorer iframe

每当用户在输入验证码文本时出错时,我都会使用iframe来刷新验证码。

这个iframe位于一个看起来像这样的形式......

<iframe id="cvbnm" frameborder="0" width="176" height="75" marginheight="0" marginwidth="0">     </iframe>   

每当用户键入错误的验证码时,我正在使用

 $("#cvbnm").attr("src", "captcha.php");  

其中captcha.php是包含验证码文件的不同页面。

这在firefox中运行良好....但是没有刷新... 请帮帮我....

1 个答案:

答案 0 :(得分:0)

您可能希望在此问题中添加jQuery标记。

可能发生的事情是,由于src保持不变,因此IE不会为页面生成新的请求。

尝试

$('#cvbnm').removeAttr('src').attr('src', 'captcha.php');

或者

$('#cvbnm').attr('src', '').attr('src', 'captcha.php');

更新

好的,如何添加

parent.frames[FrameID].window.location.reload();

或者

document.getElementById(FrameID).contentDocument.location.reload(true);

我必须承认我从here

获得了这个