【问题标题】:iframes problem in ieie中的iframe问题
【发布时间】:2009-03-28 08:30:19
【问题描述】:

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

这个 iframe 在一个看起来像这样的表单中......

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

每当用户输入错误的验证码时,我都会使用

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

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

这在 Firefox 中运行良好....但在 ie 中不刷新... 请帮帮我....

【问题讨论】:

    标签: jquery internet-explorer iframe


    【解决方案1】:

    您可能想为这个问题添加一个 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得到这个的

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-12
      • 2014-08-31
      • 2014-07-16
      • 2010-10-07
      • 1970-01-01
      • 2012-12-16
      • 1970-01-01
      • 2011-01-09
      相关资源
      最近更新 更多