Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #21722 > unrolled thread

Re: Closing a tab in mobile safari

Started byferhataydin88@gmail.com
First post2013-10-25 00:59 -0700
Last post2015-05-08 17:21 +0200
Articles 3 — 3 participants

Back to article view | Back to comp.lang.javascript

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Closing a tab in mobile safari ferhataydin88@gmail.com - 2013-10-25 00:59 -0700
    Re: Closing a tab in mobile safari babyliner1026@gmail.com - 2015-05-08 05:49 -0700
      Re: Closing a tab in mobile safari "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-08 17:21 +0200

#21722 — Re: Closing a tab in mobile safari

Fromferhataydin88@gmail.com
Date2013-10-25 00:59 -0700
SubjectRe: Closing a tab in mobile safari
Message-ID<fd00663f-3777-4666-b107-5da30e2a7587@googlegroups.com>
On Thursday, November 24, 2011 7:11:19 AM UTC+2, Andrew Poulos wrote:
> On 23/11/2011 9:26 PM, Andrew Poulos wrote:
> 
> > On 23/11/2011 4:00 PM, Andrew Poulos wrote:
> 
> >> I have a web page that when the user clicks a link opens a new window.
> 
> >> On Safari in iOS 5 the window opens in a tab.
> 
> >>
> 
> >> The user is meant to interact with the data on the new window. After
> 
> >> they do so the window is meant to close to return them to the opener.
> 
> >>
> 
> >> Alas, using window.close(); in the opened window/tab closes all tabs
> 
> >> including the opener.
> 
> >>
> 
> >> I then tried window.opener.outline.close(); ('outline' being the name I
> 
> >> gave to the new window) but again all the tabs were closed.
> 
> >>
> 
> >> How can I close just the opened window/tab from within itself with
> 
> >> Safari on iOS 5?
> 
> >
> 
> > What's weird is that if I add a link with an onclick, and touch it, then
> 
> > just the tab will close ie. with a link like:
> 
> >
> 
> > <a href="#" onclick="window.close(); return false;">close outline</a>
> 
> >
> 
> > And I tried using initEvent to trigger a mouse click on the link and
> 
> > still all tabs closed :-(
> 
> 
> 
> Well the issue did have a solution after all. Though the guy who 
> 
> provided it doesn't want me to post about it :-(
> 
> 
> 
> Andrew Poulos

Hi, you can try this js code snippet.

var win = window.open('','_self');
win.close();

[toc] | [next] | [standalone]


#27565

Frombabyliner1026@gmail.com
Date2015-05-08 05:49 -0700
Message-ID<b5190245-c4a9-4922-bb46-e29fda32ad98@googlegroups.com>
In reply to#21722
在 2013年10月25日星期五 UTC+8下午3:59:54,ferhat...@gmail.com写道:
> On Thursday, November 24, 2011 7:11:19 AM UTC+2, Andrew Poulos wrote:
> > On 23/11/2011 9:26 PM, Andrew Poulos wrote:
> > 
> > > On 23/11/2011 4:00 PM, Andrew Poulos wrote:
> > 
> > >> I have a web page that when the user clicks a link opens a new window.
> > 
> > >> On Safari in iOS 5 the window opens in a tab.
> > 
> > >>
> > 
> > >> The user is meant to interact with the data on the new window. After
> > 
> > >> they do so the window is meant to close to return them to the opener.
> > 
> > >>
> > 
> > >> Alas, using window.close(); in the opened window/tab closes all tabs
> > 
> > >> including the opener.
> > 
> > >>
> > 
> > >> I then tried window.opener.outline.close(); ('outline' being the name I
> > 
> > >> gave to the new window) but again all the tabs were closed.
> > 
> > >>
> > 
> > >> How can I close just the opened window/tab from within itself with
> > 
> > >> Safari on iOS 5?
> > 
> > >
> > 
> > > What's weird is that if I add a link with an onclick, and touch it, then
> > 
> > > just the tab will close ie. with a link like:
> > 
> > >
> > 
> > > <a href="#" onclick="window.close(); return false;">close outline</a>
> > 
> > >
> > 
> > > And I tried using initEvent to trigger a mouse click on the link and
> > 
> > > still all tabs closed :-(
> > 
> > 
> > 
> > Well the issue did have a solution after all. Though the guy who 
> > 
> > provided it doesn't want me to post about it :-(
> > 
> > 
> > 
> > Andrew Poulos
> 
> Hi, you can try this js code snippet.
> 
> var win = window.open('','_self');
> win.close();

It works!thank you!

[toc] | [prev] | [next] | [standalone]


#27566

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2015-05-08 17:21 +0200
Message-ID<XnsA494B0A221D35eejj99@194.109.133.246>
In reply to#27565
babyliner1026@gmail.com wrote on 08 mei 2015 in comp.lang.javascript:

>> var win = window.open('','_self');
>> win.close();

===

window.open('','_self').close(); 

==[chrome]

window.close();

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web