0

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?

James Allardice
  • 164,175
  • 21
  • 332
  • 312
Jason
  • 7,612
  • 14
  • 77
  • 127

2 Answers2

0

The answer here didn't work for me, but there is an example implementation here that did: http://benalman.com/code/projects/jquery-hashchange/examples/document_domain/

document.domain needs to be set before jQuery is loaded, and it must match the document.domain setting in the hashchange.src file.

David Hammond
  • 3,286
  • 1
  • 24
  • 18
0

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.

Jason
  • 7,612
  • 14
  • 77
  • 127