javascript - How can i get the current src of an iframe which is redirected - Stack Overflow

I am making a manual login flow with facebook without js sdk i have an iframe to get user approval it w

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745468243a4629013.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信