Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > how to know whether the webpage is the top active IE window with javascript code

Reply
Thread Tools

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

 
 
victorzou
Guest
Posts: n/a
 
      03-31-2007
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

 
Reply With Quote
 
 
 
 
OmegaJunior
Guest
Posts: n/a
 
      03-31-2007
On Sat, 31 Mar 2007 03:57:14 +0200, victorzou <>
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/
 
Reply With Quote
 
 
 
 
OmegaJunior
Guest
Posts: n/a
 
      04-01-2007
On Sat, 31 Mar 2007 20:16:49 +0200, Randy Webb <>
wrote:

> OmegaJunior said the following on 3/31/2007 1:30 PM:
>> On Sat, 31 Mar 2007 03:57:14 +0200, victorzou <>
>> 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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Clipping a remote webpage with Javascript/XPath and including in a "local" webpage soren625 Javascript 2 12-12-2006 02:09 PM
How do we know the memory arrangement using in microprocessors? Top-Bottom or Bottom-Top? Cuthbert C Programming 8 09-13-2006 12:09 PM
Detect whether javascript threw an alert window (with javascript) umdsasha@gmail.com Javascript 3 08-24-2006 06:25 AM
window.opener.top.location.top.close ??? find clausen Javascript 2 10-05-2003 04:35 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57