Search code examples
jqueryhashhashchangejquery-bbq

jQuery BBQ - "Access Denied" in IE


I'm running into issues with jQuery BBQ in IE7 and IE8 compatibility mode.

history_set = function( hash, history_hash )

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

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

I get an "Access Denied" on the line marked above.

I've heard this can be caused by the iframe having a domain issue, so I set

document.domain = "mydomain.com";

but still seeing the issue.

help?


Solution

  • Ok, for anyone else receiving this error, this is how we fixed it.

    First, at the suggestion of Ben Alman, we made a one line change to the plugin. Where the iframe is appended to the window, .contentWindow we change to .document

    We also needed to use the blank html file, and set the source:

    //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
    

    With those changes, everything works as expected.