top.location.href doesn't work in IE 8
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 out开发者_开发问答side the iframe, in this case the apps.facebook.com/application
URL and not my domain URL)
Anyone have any solution?
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.
精彩评论