简体   繁体   English

Facebook分享对话取消按钮未关闭窗口

[英]Facebook sharing dialogue cancel button doesn't window close

I have a facebook share button setup with this event and url: 我使用此事件和网址设置了Facebook分享按钮:

window.open('https://www.facebook.com/dialog/feed?app_id={{myid}}&display=popup&' +
      'link={{my url}}&redirect_uri={{my url again}}', 'The title', 'resizable,height=400,width=550');

My issue is when I click cancel, instead of closing my open window, the user is directed to {{my url}} (the same url as {{my url again}} 我的问题是,当我单击“取消”时,而不是关闭打开的窗口,而是将用户定向到{{我的网址}}(与{{我的网址再次}相同的网址)

What am I missing? 我想念什么?

I ended up using: 我最终使用:

if (window.location.hash == '#_=_') {
        open(location, '_self').close();
}

Not the best solution, I don't think. 我认为这不是最佳解决方案。 The hash location is the url the Facebook cancel button directs from. 哈希位置是Facebook取消按钮所指向的URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM