2012-02-22 68 views
0

我在IE7和IE8兼容模式下遇到jQuery BBQ的问题。jQuery BBQ - IE中的“访问被拒绝”

history_set = function(hash, history_hash) 

var iframe_doc = iframe.document, //this is the line that the error reports 

domain = $.fn[ str_hashchange ].domain;` 

我在上面标记的行上得到“拒绝访问”。

我听说这可以通过具有域问题的iframe引起的,所以我设置

document.domain = "mydomain.com"; 

,但仍然看到这个问题。

有帮助吗?

回答

0

好的,对于接收这个错误的其他人,这是我们如何修复它的。

首先,在Ben Alman的建议下,我们对插件做了一个改动。其中的iframe被附加到窗口,.contentWindow我们改变.document

我们还需要使用空白的html文件,并设置源:

//set iframe src file, will not work in IE7 & compat modes without 
      jQuery.fn.hashchange.domain = document.domain; 
      jQuery.fn.hashchange.src = 'blank.html'; 

      //Initialize our BBQ 
        blah blah blah 

这些变化,一切正常。