【问题标题】:SimpleModal IE8 IssueSimpleModal IE8 问题
【发布时间】:2013-11-15 13:49:24
【问题描述】:

在 Internet Explorer 中遇到问题...当然。 我在其中测试过的所有其他浏览器都运行良好... 我希望有人可以帮助我 基本上,如果推荐人不是我们,则显示简单模式弹出窗口。

 <!-- Init Age Verification Content -->

<div class="age" id="verify"> 
    <div><img src="/image/white.png"></img></div>
    <div id="noman">ARE YOU OVER 18?</div>
    <div> 
      <p> If not, leave now and we wont tell your mom.
        </br>  By continuing you agree you are 18 or older.
      </p>
    </div>
    <div id="YN">
      <a href="javascript:window.location.href=window.location.href" id="old">Yes</a>
        &nbsp;&nbsp;&nbsp;&nbsp;
      <a href="http://www.sendoff.com" rel="nofollow" id="young">No</a>
    </div>
</div>

<!-- If previous page wasnt from us... Verify -->

  <script>
if ( document.referrer == null || document.referrer.indexOf(window.location.hostname) < 0 ) {
$("#verify").modal({opacity:85, position: ["20%",""], onOpen: function (dialog) {
    dialog.overlay.fadeIn('slow', function () {
        dialog.container.slideDown('slow', function () {
            dialog.data.fadeIn('slow');
            return false;
        });
    });
}});
}
</script>

但我在 IE8 中不断收到此错误:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
Timestamp: Tue, 16 Jul 2013 12:14:28 UTC


Message: Not implemented

Line: 454
Char: 7
Code: 0
URI: http://www.example.com/catalog/view/javascript/jquery/jquery.simplemodal-1.4.4.js


Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
Line: 0
Char: 0
Code: 0
URI: http://www.example.com/

感谢您在 Advance 中的帮助!

【问题讨论】:

  • 你见过this bug report吗?尝试将ieQuirks = $.browser.msie &amp;&amp; !$.boxModel; 更改为ieQuirks = jQuery.support.boxModel;

标签: javascript internet-explorer-8 simplemodal


【解决方案1】:

您应该尝试仅在 DOM 加载后运行您的脚本

<script>
$(document).ready(function(){
if ( document.referrer == null || document.referrer.indexOf(window.location.hostname) < 0 ) {
$("#verify").modal({opacity:85, position: ["20%",""], onOpen: function (dialog) {
    dialog.overlay.fadeIn('slow', function () {
        dialog.container.slideDown('slow', function () {
            dialog.data.fadeIn('slow');
            return false;
        });
    });
}});
}
});
</script>

【讨论】:

  • 这行得通,但是现在当您单击“是”链接时,它只会一遍又一遍地调出简单模式。
  • 在其他一些人的帮助下,我得到了这个正常工作。最终解决方案请见This workaround
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-07
  • 2013-01-10
相关资源
最近更新 更多