javascript - self.close() or Window.close() not working on Chrome and Firefox - Stack Overflow

Self.close() is working For IE but For Chrome and Firefox it shows that Scripts may close only the wind

Self.close() is working For IE but For Chrome and Firefox it shows that

Scripts may close only the windows that were opened by it.

And This Page will not a popup and it is not open by java script so what are the alternative way to close window by Script which is not open by it.

Self.close() is working For IE but For Chrome and Firefox it shows that

Scripts may close only the windows that were opened by it.

And This Page will not a popup and it is not open by java script so what are the alternative way to close window by Script which is not open by it.

Share Improve this question edited Jan 10, 2017 at 6:24 Suren Srapyan 68.7k14 gold badges125 silver badges117 bronze badges asked Jan 10, 2017 at 6:21 curogalcurogal 731 gold badge2 silver badges5 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 0

You simply can not close the window by script due to security reasons on chrome and firefox. But there is a workaround posted here. That works on chrome 40 and latest version as I have tested.

chrome closing of opened window

I know it's too late to answer but none of these solution worked for me . I wrote

      onclick="top.window.close();"

and it worked .

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

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

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

关注微信