admin管理员组

文章数量:1426938

I am making a manual login flow with facebook without js sdk i have an iframe to get user approval it works fine and returns short-lived access token withn url but the problem when i want to get the url like iframe.src it returns the src i provided not redirected and which contains facebooks response.The question is how i can get redirected current url of an iframe . i tried iframe.location.href but it seems iframe doesnt have dom inside, and location is undefined.

I am making a manual login flow with facebook without js sdk i have an iframe to get user approval it works fine and returns short-lived access token withn url but the problem when i want to get the url like iframe.src it returns the src i provided not redirected and which contains facebooks response.The question is how i can get redirected current url of an iframe . i tried iframe.location.href but it seems iframe doesnt have dom inside, and location is undefined.

Share Improve this question asked Aug 4, 2015 at 17:55 nikossnikoss 3,7183 gold badges29 silver badges45 bronze badges 4
  • Why not using the facebook javascript SDK ? Also, share code on how are you doing it through an iframe. – coding_idiot Commented Aug 4, 2015 at 17:57
  • that's a weird way of doing it.. – Nitesh Oswal Commented Aug 4, 2015 at 18:06
  • Try document.referrer see stackoverflow./questions/3420004/… – Daniel Lizik Commented Aug 4, 2015 at 19:34
  • nope it returns wrong value i tried already – nikoss Commented Aug 4, 2015 at 19:54
Add a ment  | 

1 Answer 1

Reset to default 4

I found out i can use frame.contentWindow.location after it returns to my site

本文标签: javascriptHow can i get the current src of an iframe which is redirectedStack Overflow