Re: how to know whether the webpage is the top active IE window with javascript code



On Sat, 31 Mar 2007 03:57:14 +0200, victorzou <victor.zou@xxxxxxxxxxx> wrote:

hi all ;
I am new guy!
I need to know whether the webpage is the top active IE window
with javascript in the webpage,when I open 2 or more IE window.


tks in advance!
victor.zou


What if the user is browsing with Opera or Firefox? Don't you want to know whether the web page is the topmost in those cases as well? Or do you only need to know it if the user is browsing with MSIE?

Other than that, figuring out which window is the active topmost on a user's computer can probably be figured out using window.onfocus() or document.onfocus().

Haven't tested this:

<html>
<body onfocus="alert('Hello, world!')">
<p>Hello, world!</p>
</body>
</html>

then when switching between different browser windows with the same page, each page should alert.

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
.



Relevant Pages

  • Open a new window and set session variable?
    ... linkbutton get clicked. ... webpage that in the new window. ... to set the session variable's value and also execute client javascript ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Opening a new window
    ... This is all still client side javascript. ... > How do I open a new window (webpage) without closing the current webpage ... The new window will be smaller and centered on the ...
    (microsoft.public.dotnet.languages.csharp)
  • how to know whether the webpage is the top active IE window with javascript code
    ... I need to know whether the webpage is the top active IE window ... with javascript in the webpage,when I open 2 or more IE window. ... tks in advance! ...
    (comp.lang.javascript)
  • Re: Javascript disabled in my browser?
    ... I have already enabled Active Scripting ... > Click "OK" to close the Security window. ... > JavaScript is now enabled for our web site. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: javascript:OpenChildWindow
    ... or on the MSN username) nothing happens. ... I right click on the image and select to open in a new window ... browsers and they break useful browser GUI ... when you click on a javascript pseudo-protocol link ...
    (comp.lang.javascript)