473,241 Members | 1,426 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

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

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

Mar 31 '07 #1
3 2600
On Sat, 31 Mar 2007 03:57:14 +0200, victorzou <vi********@hotmail.com
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/
Mar 31 '07 #2
OmegaJunior said the following on 3/31/2007 1:30 PM:
On Sat, 31 Mar 2007 03:57:14 +0200, victorzou <vi********@hotmail.com>
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?
That wasn't the question, now was it?
Don't you want to know whether the web page is the topmost in
those cases as well?
Obviously not or the question would/could have been worded differently.
Or do you only need to know it if the user is browsing with MSIE?
That appears to be what was asked. Perhaps it could even be an MSIE
Intranet situation where no other browser is used.

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().
Or probably not. Try reading the question again.
Haven't tested this:
Perhaps you should. And then follow your own advice in another thread:
<quote>
First: please to validate your page using a decent validator. Try this one:
http://validator.w3.org/
</quote>
<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.
And that still doesn't answer the question that was asked.

BTW, your posting agent is broken.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 31 '07 #3
On Sat, 31 Mar 2007 20:16:49 +0200, Randy Webb <Hi************@aol.com
wrote:
OmegaJunior said the following on 3/31/2007 1:30 PM:
>On Sat, 31 Mar 2007 03:57:14 +0200, victorzou <vi********@hotmail.com
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?

That wasn't the question, now was it?
>Don't you want to know whether the web page is the topmost in those
cases as well?

Obviously not or the question would/could have been worded differently..
>Or do you only need to know it if the user is browsing with MSIE?

That appears to be what was asked. Perhaps it could even be an MSIE
Intranet situation where no other browser is used.

>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().

Or probably not. Try reading the question again.
>Haven't tested this:

Perhaps you should. And then follow your own advice in another thread:
<quote>
First: please to validate your page using a decent validator. Try this
one:
http://validator.w3.org/
</quote>
><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.

And that still doesn't answer the question that was asked.

BTW, your posting agent is broken.
Then please enlighten us and explain how the question can be interpreted
differently?

My posting agent broken? How so?
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Apr 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Mary Catherine | last post by:
I have 2 scipts that I am trying to get to run on the same page. One is a time/date script, the other is a countdown script (i.e. countdown days, hours, mins until a given date). They both work...
9
by: Christopher Benson-Manica | last post by:
I have the following situation: Page A opens a window named 'foo'. Page A then reloads itself. Is there a way for the reloaded Page A to determine whether there is an open window named 'foo',...
13
by: Jitendra | last post by:
Hi! I m facing a problem with 'javascript:void(0)' Software Environ:- IE: 6.0.2600.0000 OS: Windows 2000 Professional with Service Pack 4 Problem:- I have a webpage with several links (<A>...
4
by: Sarita Sai Bhushan | last post by:
Hi, While I was developing a active desktop web page in ASP.Net using server controls I faced a problem with the autopostback property of server control. The sever control I used in my aspx page...
3
by: Atul | last post by:
Hi, I am running .NET Framework 2.0 on windows XP SP2. I am stuck in a situation where I need to find out a list of all active sessions running in IIS for a web application. I know that .NET...
1
by: Taoge | last post by:
Hi, Is there anyway to active print preview function in asp.net web page? Thanks
7
by: babacrash | last post by:
Hello, I have designed a webpage mainly consisting in JavaScript code. It has to load an XML document's content when it is loaded so as to show a content depending on the XML data. Both the...
2
by: Martin \(Martin Lee\) | last post by:
Hi, I am new in C sharp. I make a button, when users click the button, I want it to open a webpage (for example www.yahoo.com ) How to do? What should the code be? Thanks!
14
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I tried a google search but could not find anything. I am trying to cause one webpage to reload when a second web page is closed. The second webpage loads data into a session variable and when...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.