2012-02-22 67 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 

這些變化,一切正常。