473,320 Members | 2,012 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,320 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 2601
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...
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: 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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.