/    Sign up×
Community /Pin to ProfileBookmark

"Singeltone" window

Hello.

Is there any way to open specific window only once ?
I have some URL that I want the user to open only one instance of.
I don’t want to use modal window as the user can do other things while window is open.

thanks.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@hyperliskMar 27.2006 — You can do something like this:
<i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;One Instance&lt;/title&gt;
&lt;script language="JavaScript"&gt;
myWin = false;
function doWindow(){
if(!myWin){
myWin = window.open("http://www.nicksscripts.be","");
}
if(myWin.closed){
myWin = window.open("http://www.nicksscripts.be","");
}
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;input type="button" onClick="doWindow()" value="Open the Window"&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@gtekAmirauthorMar 27.2006 — Is there any way to do it without using HTML ?

something in the window.open properties ?

Thanks.
Copy linkTweet thisAlerts:
@hyperliskMar 27.2006 — What do you mean? It doesn't need HTML, I just have the button there to start the event. You could use any event handler.
×

Success!

Help @gtekAmir spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...