Skip to main content

Bug Tracker

Side navigation

#4288 closed bug (invalid)

Opened March 04, 2009 05:40AM UTC

Closed October 13, 2009 12:43AM UTC

Last modified March 15, 2012 02:02PM UTC

jQuery not working inside Facebook iframe-based application

Reported by: rafidka Owned by:
Priority: major Milestone:
Component: unfiled Version:
Keywords: Cc:
Blocked by: Blocking:

Dear Sir/Madam,

I am developing a Facebook application using iframe. I want to use jQuery but I get the following error in IE (I do not get this problem in FF and Chrome):

"Access is denied"

on line 2945, which is this:

if (document.documentElement.doScroll && !window.frameElement) (function(){

After some tracing, I found that the source of the problem is trying to access window.frameElement, which is forbidden in IE (if the host of the iframe is different in domain) for security reasons. Please check this for more information.

I would be very thankful if you let me know when you fix this bug. Here is my email address:



Attachments (0)
Change History (2)

Changed March 04, 2009 06:01AM UTC by rafidka comment:1

I found a solution for this bug. I added the following code to to know whether we are in iframe or not:

var notInFrame = true;

try {

notInFrame = !window.frameElement;

} catch(ex) {

If accessing the frameElement fails, a frame is probably in a different

domain than its parent.

notInFrame = false;


Then later, I used this line:

if ( document.documentElement.doScroll && notInFrame ) (function(){

instead of this:

if ( document.documentElement.doScroll && !window.frameElement ) (function(){

This solved the problem. Please check this for more information:

Changed October 13, 2009 12:43AM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed