Jump to content

document.location in IE


Brian W

Recommended Posts

I'm writing an Facebook app and ran into an interesting problem. I'm using the iFrame option. I'm using a button with a onClick event to change the document.location with in FF works fine, but in IE it takes them away from facebook directly to the page on my server. I didn't expect Facebook would allow for something like this, but I can direct them away from Facebook entirely! First this shakes my trust in any Facebook application in the future as well as IE (just begging for phishing problems!).

Any ways, I want to know how to get just the iFrame's location to change as in how FF does it.

Link to comment
Share on other sites

Hmm, thought I had provided enough information.

Facebook allows you to pick between their markup language or use an I frame when developing an Application for Facebook users.

I chose to do an iFrame so I could use JS and not worry about learning there language. I've encountered a problem now with navigation in IE(8 + 8 compatibility mode) because I'm using document.location='pageToGoTo' to move the end user to a new page. Problem, in FF(3) the the iFrame's src changes which is how I intended it to work... in IE it takes the user away from Facebook to my website.

I could change the iFrame src if that is a possible solution, but how do I do that from within the iFrame?

 

Not important to my problem perse, but doesn't allowing the app to move a user away from Facebook un-knowingly a security hole for the user. Imagine an app that would at some random point move the user to a Facebook clone page that came up with the classic,well known message saying you needed to log in again. Viola, phished. I'm not sure how many users actually ever look at their url when they are prompted for private data... but I know it is a small percentage.

Link to comment
Share on other sites

I got the frame's id and tried to call it like this:

top.frames['theId'].location = 'thepage'

FF doesn't respond to it, IE acts like I simply said window.location.

I also tried:

top.frames['theId'].src = 'thepage'

and

theId.location = 'thepage'

 

I tried several more things, then I tried using the frame's name with top like:

top.iframe_canvas.location

which to me I think so far is the most promising but IE still treats it the same as window.location as well as FF (which is okay, FF functions as it should not surprisingly)

 

Thanks so far for everyone's input. Anymore ideas?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.