Display new window on top (showModelessDialog() )

This is part of a code to open a new browser window. I want to add code to display it on top of the other windows, most time goes to the back and people can't see it.

---

sAny='status=yes,toolbar=no, scrollbars=yes,personalbar=no,maximize=no,resizable=yes,left=200,top=200,height='+nH+',width='+nW;

---

How to add a parameter to show on top ?
LVL 1
AleksAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pateljituCommented:
Please give this code a try:

<script type="text/javascript">
function Windowopener() {
   newwindow = window.open('testpage.asp', 'testPage', 'height=200,width=200, toolbar=no, scrollbars=yes,personalbar=no,maximize=no,resizable=yes,left=200,top=200');
 
  if (window.focus) {newwindow.focus();}
 
  return false;
}
</script>
<a href="#" onclick="return Windowopener()">Open Window</a>

Open in new window


Also if you looking for modal window please take a look at these articles:


http://jqueryui.com/dialog/
0
AleksAuthor Commented:
Thanks.

Unfortunately part of it is not my code, so I can't change the way the window is open, only add parameters to the current code.
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Personally, I like where pateljitu is going with using a modal instead of a pop up.  You may get some browsers blocking a pop up.  If that is all you have to work with then on the page that needs to go on top, the only way I know of is adding self.focus() like this.

<body onblur="self.focus();">

Open in new window


You will see in most newer sites a modal is used instead of a pop up.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

pateljituCommented:
@amucinobluedot;
Could you please provide with complete code on how opening of new window is triggered.

padas:
Definitely this is something new to not post other Q/A sites. But will keep in mind.
0
AleksAuthor Commented:
I tried this and didnt work.

<body onblur="self.focus();">
0
AleksAuthor Commented:
Any other ideas ?
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I think without being able to alter code, there is not much more you can do.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.