Reputation: 229
I'm developing a small web app using ASP.NET. One of my function in this system is to open a new window tab, I've put a button close after they save the document but it seems it's only working on desktop.
Here's my code.
<asp:Button ID="Button2" runat="server" Text="Close" OnClientClick="javascript: window.close();"/>
I'm using Opera mini as a browser in my mobile (SIII).
Upvotes: 0
Views: 2549
Reputation: 15387
Try this
<asp:Button ID="Button2" runat="server" Text="Close" OnClientClick="return self.close();"/>
Upvotes: 1
Reputation: 66389
I fear you're out of luck, Opera Mini browser won't let you close windows with JavaScript, by design.
Taken from the official documentation: (emphasis mine)
Opening and closing windows
Opera Mini also doesn't support using JavaScript to open new windows (such as window.open()). If you use window.open() to launch a new window, Opera Mini will instead load that page as a new 'screen.' It will not open a new window or tab. Similarly, because a new window was never opened, window.close() will not work. (This is also true of the target attribute of HTML.)
Upvotes: 2