[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 389
  • Last Modified:

window.open setAlwaysonTop

I am creating the following JavaScript to open a new window.  In some cases, the window does not open on top and the user must hunt for it.  

<script>
 function FeedBack(X)
 { window.open(X);
window.location.reload(true);
}
</script>

I'm thinking that I need to use setAlwaysontop, but I don't know how to call it.
0
mpiaser
Asked:
mpiaser
  • 5
  • 2
2 Solutions
 
hujiCommented:
Does this help:

<script>
 function FeedBack(X)
 {
    winTmp = window.open(X);
    winTmp.setAlwaysontop(true);
    window.location.reload(true);
 }
</script>
0
 
hujiCommented:
But you should also notice that Setalwaysontop doesn't work in many browsers. For example in Mozilla, a newly opened window is shown behind the current window when you use the above code.

Sorry for double posting
Huji
0
 
mpiaserAuthor Commented:
I get an "Error - object doesn't support this property or method"
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
hujiCommented:
Typical. As I said, setAlwaysontop is not available on most browsers.
0
 
mpiaserAuthor Commented:
This is IE 7.  Is there another way to accomplish launching a new browser window and setting it as to top(focused) window?
0
 
hujiCommented:
As far as I know, there is no way to do that. Focusing is available for the objects, but not for the window. I will search in the internet too, and let you know if I found a way to do that, but as far as I know, the answer is negative.
0
 
hujiCommented:
I searched for you. There is no way to "keep" a window "always" on top. Perhaps you can bring it back to focus like this:

<script language="javascript" type="text/javascript">
function popup(url) {
      newwindow=window.open(url,'name','height=200,width=150');
      if (window.focus) {newwindow.focus()}
      return false;
}
</script>
0
 
Michel PlungjanIT ExpertCommented:
or in the body tag of the opened window

<body onLoad="window.focus()">
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now