admin管理员组

文章数量:1287577

top.location.href doesn't work in IE8 from my facebook application when i redirect people to another URL.

Anyone have any other solution to redirect a user to another URL (It's need to redirect the URL outside the iframe, in this case the apps.facebook/application URL and not my domain URL)

Anyone have any solution?

top.location.href doesn't work in IE8 from my facebook application when i redirect people to another URL.

Anyone have any other solution to redirect a user to another URL (It's need to redirect the URL outside the iframe, in this case the apps.facebook./application URL and not my domain URL)

Anyone have any solution?

Share Improve this question edited Feb 2, 2012 at 13:32 VMAtm 28.4k17 gold badges83 silver badges132 bronze badges asked Jul 15, 2011 at 20:01 Simon ThomsenSimon Thomsen 1,4217 gold badges28 silver badges37 bronze badges 3
  • Do you get a yellow triangle in the corner? – mplungjan Commented Jul 15, 2011 at 20:22
  • It's working now with @VMAtm 's solution :-) – Simon Thomsen Commented Jul 15, 2011 at 20:41
  • Very strange. Perhaps they have hijacked "top" – mplungjan Commented Jul 15, 2011 at 20:48
Add a ment  | 

4 Answers 4

Reset to default 6

Try to use window.top.location = "NEW_URL" for the IE. Or, if your code is run from iframe, parent.location = "NEW_URL"

Fairly old post, but I'd thought I'd share the solution that worked for me:

I found that when in an iFrame (within a Facebook Tab), I had to use

parent.location.href = "NEW URL";

I had the same problem and you would not believe what the error was... i added a line in de dsk of facebook (facebook.php)! I downloaded the latest version, but i think it wasn't updated since Auth2.0

Wrong:

    protected static $DROP_QUERY_PARAMS = array(
       'code',
       'state',
      'signed_request',
    );

Right:

    protected static $DROP_QUERY_PARAMS = array(
       'code',
       'state',
       'signed_request',
   'base_domain',
    );

The redirect was only not working in IE, after this modification it worked..

top.location.href= "URL" works for me, just make sure that the URL is absolute.

本文标签: javascripttoplocationhref doesn39t work in IE 8Stack Overflow