/    Sign up×
Community /Pin to ProfileBookmark

Keeping window focused until closed by the user

Hi all,

I have a script that loads a web site in a popup window. I need to keep the popup in focus until the user closes it.

The code I am working with is:

[code]
<script type=”text/javascript”>
function PopupCenter(URL, title,w,h) {

var URL
var w
var h

w = 1150;
h = 800;

URL = ‘dinamic content from sql table’;

var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (URL, title, ‘toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=’+w+’, height=’+h+’, top=’+top+’, left=’+left);

}
</script>
[/code]

Can anyone see how I can make this keep focus.

Many thanks in advance

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @dcjones 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

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