473,703 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<BODY onBlur="resizeT o(150,150)"> doesn't work in IE6

rob
Hi

I'm trying to create a "roll-up" effect when a window loses focus and then
"roll-down" when it regains focus.

This statement works properly with every browser I can get my hands on EXCEPT
WinIE6. WinIE6 says there's an error in the code, but the debugging info says
the problem is on line 1 char 1, which are comments.

<Body bgcolor='black' Text='#dbdbdb' onblur='window. resizeTo(150,15 0)'
onfocus='window .resizeTo(150,3 00)'>

TIA
Rob
www.rcp.ca

Jul 23 '05 #1
6 7322
rob wrote:
Hi

I'm trying to create a "roll-up" effect when a window loses focus and then
"roll-down" when it regains focus.

This statement works properly with every browser I can get my hands on EXCEPT
WinIE6. WinIE6 says there's an error in the code, but the debugging info says
the problem is on line 1 char 1, which are comments.
IE6 SP2 on WinXP doesn't give that error, it gives an access denied
error. But it points to the same place, which is the body tag. Its part
of IE's "great" error messages.
<Body bgcolor='black' Text='#dbdbdb' onblur='window. resizeTo(150,15 0)'
onfocus='window .resizeTo(150,3 00)'>


When you say "works properly" with every browser except IE, did you test
that code in Mozilla? It does not work for me there, it does nothing. It
also does nothing in Opera. So where *does* it work for you?

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #2
rob
In message <H7************ ********@comcas t.com> - Randy Webb
<Hi************ @aol.com> writes:
:>
:>rob wrote:
:>
:>> Hi
:>>
:>> I'm trying to create a "roll-up" effect when a window loses focus and then
:>> "roll-down" when it regains focus.
:>>
:>> This statement works properly with every browser I can get my hands on EXCEPT
:>> WinIE6. WinIE6 says there's an error in the code, but the debugging info says
:>> the problem is on line 1 char 1, which are comments.
:>
:>IE6 SP2 on WinXP doesn't give that error, it gives an access denied
:>error. But it points to the same place, which is the body tag. Its part
:>of IE's "great" error messages.
:>
:>> <Body bgcolor='black' Text='#dbdbdb' onblur='window. resizeTo(150,15 0)'
:>> onfocus='window .resizeTo(150,3 00)'>
:>
:>When you say "works properly" with every browser except IE, did you test
:>that code in Mozilla? It does not work for me there, it does nothing. It
:>also does nothing in Opera. So where *does* it work for you?
:>
:>--
:>Randy
:>comp.lang.jav ascript FAQ - http://jibbering.com/faq & newsgroup weekly

Hi Randy

Here's the entire test code
-----
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<Html>
<Head>
<Title>blur test</Title>
</Head>
<Body onblur="window. resizeTo(150,15 0)" onfocus="window .resizeTo(150,3 00)">

this is a test window

</Body>
</Html>
-----

I've tested this on Mozilla 1.7.5 (on WinXPpro), WinIE5 (on Win98) and
Opera(on WinXPpro). When you click anywhere on the desktop the browser window
shrinks, making it the active window restores it.

With WinIE6(on WinXPpro), the window doesn't change.

I just tried something... If I change onblur to do a "window.clo se" instead of
a "window.resize" , then it works as expected (the window closes) with all of
the above mentioned browsers.

It appears to be related to the "window.res ize" routine.
I'll try this same test at work tomorrow with IE6 on WinXP home & Win98
systems and see what happens.

thanks
Rob
www.rcp.ca

Jul 23 '05 #3
In article <11************ *@corp.supernew s.com>, gr***********@r cp.ca
enlightened us with...

<Body bgcolor='black' Text='#dbdbdb' onblur='window. resizeTo(150,15 0)'
onfocus='window .resizeTo(150,3 00)'>


In case you weren't aware, Opera and Mozilla/Firefox have options to prevent
window resizing. Window resizing causes problems in tabbed browsers if I open
the document in a tab when you assumed I was opening it in its own window;
the code ends up resizing ALL my open tabs. Very irritating.
And ALL new windows open in tabs for me and anyone else who sets their
Firefox to do that. Opera may have a similar option.

As to the problem, you may want to change window.resizeTo to self.resizeTo in
the onBlur. That's all I can think of.

--
--
~kaeli~
Those who get too big for their britches will be exposed in
the end.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4
rob
In message <MP************ ************@nn tp.lucent.com> - kaeli
<ti******@NOSPA M.comcast.net> writes:
:>
:>In article <11************ *@corp.supernew s.com>, gr***********@r cp.ca
:>enlightened us with...
:>>
:>> <Body bgcolor='black' Text='#dbdbdb' onblur='window. resizeTo(150,15 0)'
:>> onfocus='window .resizeTo(150,3 00)'>
:>>
:>
:>In case you weren't aware, Opera and Mozilla/Firefox have options to prevent
:>window resizing. Window resizing causes problems in tabbed browsers if I open
:>the document in a tab when you assumed I was opening it in its own window;
:>the code ends up resizing ALL my open tabs. Very irritating.
:>And ALL new windows open in tabs for me and anyone else who sets their
:>Firefox to do that. Opera may have a similar option.
:>
:>As to the problem, you may want to change window.resizeTo to self.resizeTo in
:>the onBlur. That's all I can think of.
:>
:>--
:>--
:>~kaeli~

Hi

Thanks for letting me know about the tabbed browser problems.

I've been doing some testing on a variety of systems and the only combination
that doesn't resize properly is XP Pro (sp2) with IE6 (sp2). The sp1 levels
work fine as do older versions of Windows & IE. Personally, I prefer Mozilla
anyway.

If I change window.resize to window.close and load it into an sp2 system, then
the window closes as expected. Seems to be something about sp2 that doesn't
like a window.resize being called by an onblur.

Here's my test page....

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<Html>
<Head>
<Title>blur test</Title>
</Head>
<Body onblur="window. resizeTo(150,15 0)" onfocus="window .resizeTo(150,3 00)">

this is a test window

</Body>
</Html>

Thanks

Rob
www.rcp.ca

Jul 23 '05 #5
"rob" <gr***********@ rcp.ca> wrote in message
news:11******** *****@corp.supe rnews.com...
In message <MP************ ************@nn tp.lucent.com> - kaeli
<ti******@NOSPA M.comcast.net> writes:
:>
:>In article <11************ *@corp.supernew s.com>,
gr***********@r cp.ca
:>enlightened us with...
:>>
:>> <Body bgcolor='black' Text='#dbdbdb'
onblur='window. resizeTo(150,15 0)'
:>> onfocus='window .resizeTo(150,3 00)'>
:>>
:>
:>In case you weren't aware, Opera and Mozilla/Firefox have options to
prevent
:>window resizing. Window resizing causes problems in tabbed browsers
if I open
:>the document in a tab when you assumed I was opening it in its own
window;
:>the code ends up resizing ALL my open tabs. Very irritating.
:>And ALL new windows open in tabs for me and anyone else who sets
their
:>Firefox to do that. Opera may have a similar option.
:>
:>As to the problem, you may want to change window.resizeTo to
self.resizeTo in
:>the onBlur. That's all I can think of.

I've been doing some testing on a variety of systems and the only
combination
that doesn't resize properly is XP Pro (sp2) with IE6 (sp2). The sp1
levels
work fine as do older versions of Windows & IE. Personally, I prefer
Mozilla
anyway.

If I change window.resize to window.close and load it into an sp2
system, then
the window closes as expected. Seems to be something about sp2 that
doesn't
like a window.resize being called by an onblur.

Here's my test page....

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<Html>
<Head>
<Title>blur test</Title>
</Head>
<Body onblur="window. resizeTo(150,15 0)"
onfocus="window .resizeTo(150,3 00)">

this is a test window

</Body>
</Html>


Yup, you're right, IE 6.0.2900 doesn't allow that, so don't do it.

While this behaviour is not specifically addressed at <url:
http://www.microsoft.com/technet/pro...rows.mspx#ECAA
/>, it's easy enough to see how moving and resizing a window after a
user moved off it could be considered a malicious use of script. You
could mess around with the user such that everytime they moved off a
window, you could resize and move it, so the user wouldn't know where on
their desktop to find the window the next time they wanted to look at it

Consider the following script:

<script type="text/javascript">
window.onblur = function()
{
window.moveTo(
Math.random() * screen.availWid th,
Math.random() * screen.availHei ght
);
window.resizeTo (
Math.random() * screen.availWid th,
Math.random() * screen.availHei ght
);
}
var t = setInterval('wi ndow.blur()', 50);
</script>

The constant window.blur() makes it impossible to bring focus to the
window, and the constant moving and resizing prevents clicking the close
icon.

Quite frankly, you don't get much of a "window roll up" effect anyway,
since the browser continues to show it's toolbar(s), address bar and
status bar.

--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #6
rob
In message <zy************ ***@news2.mts.n et> - "Grant Wagner"
<gw*****@agrico reunited.com> writes:
:>
:>"rob" <gr***********@ rcp.ca> wrote in message
:>news:11****** *******@corp.su pernews.com...
:>> In message <MP************ ************@nn tp.lucent.com> - kaeli
:>> <ti******@NOSPA M.comcast.net> writes:
:>> :>
:>> :>In article <11************ *@corp.supernew s.com>,
:>> gr***********@r cp.ca
:>> :>enlightened us with...
:>> :>>
:>> :>> <Body bgcolor='black' Text='#dbdbdb'
:>> onblur='window. resizeTo(150,15 0)'
:>> :>> onfocus='window .resizeTo(150,3 00)'>
:>> :>>
:>> :>
:>> :>In case you weren't aware, Opera and Mozilla/Firefox have options to
:>> prevent
:>> :>window resizing. Window resizing causes problems in tabbed browsers
:>> if I open
:>> :>the document in a tab when you assumed I was opening it in its own
:>> window;
:>> :>the code ends up resizing ALL my open tabs. Very irritating.
:>> :>And ALL new windows open in tabs for me and anyone else who sets
:>> their
:>> :>Firefox to do that. Opera may have a similar option.
:>> :>
:>> :>As to the problem, you may want to change window.resizeTo to
:>> self.resizeTo in
:>> :>the onBlur. That's all I can think of.
:>>
:>> I've been doing some testing on a variety of systems and the only
:>> combination
:>> that doesn't resize properly is XP Pro (sp2) with IE6 (sp2). The sp1
:>> levels
:>> work fine as do older versions of Windows & IE. Personally, I prefer
:>> Mozilla
:>> anyway.
:>>
:>> If I change window.resize to window.close and load it into an sp2
:>> system, then
:>> the window closes as expected. Seems to be something about sp2 that
:>> doesn't
:>> like a window.resize being called by an onblur.
:>>
:>> Here's my test page....
:>>
:>> <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
:>> <Html>
:>> <Head>
:>> <Title>blur test</Title>
:>> </Head>
:>> <Body onblur="window. resizeTo(150,15 0)"
:>> onfocus="window .resizeTo(150,3 00)">
:>>
:>> this is a test window
:>>
:>> </Body>
:>> </Html>
:>
:>Yup, you're right, IE 6.0.2900 doesn't allow that, so don't do it.
:>
:>While this behaviour is not specifically addressed at <url:
:>http://www.microsoft.com/technet/pro...rows.mspx#ECAA
:>/>, it's easy enough to see how moving and resizing a window after a
:>user moved off it could be considered a malicious use of script. You
:>could mess around with the user such that everytime they moved off a
:>window, you could resize and move it, so the user wouldn't know where on
:>their desktop to find the window the next time they wanted to look at it
:>
:>Consider the following script:
:>
:><script type="text/javascript">
:>window.onblu r = function()
:>{
:> window.moveTo(
:> Math.random() * screen.availWid th,
:> Math.random() * screen.availHei ght
:> );
:> window.resizeTo (
:> Math.random() * screen.availWid th,
:> Math.random() * screen.availHei ght
:> );
:>}
:>var t = setInterval('wi ndow.blur()', 50);
:></script>
:>
:>The constant window.blur() makes it impossible to bring focus to the
:>window, and the constant moving and resizing prevents clicking the close
:>icon.
:>
:>Quite frankly, you don't get much of a "window roll up" effect anyway,
:>since the browser continues to show it's toolbar(s), address bar and
:>status bar.
:>
:>--
:>Grant Wagner <gw*****@agrico reunited.com>
:>comp.lang.jav ascript FAQ - http://jibbering.com/faq
:>
:>

Thanks for the info and the link (it made for an interesting read).

I showed some friends what I was trying to do, they went "yuck" and I went
hmmmm-maybe this isn't a good idea after all.

Thanks
Rob
Jul 23 '05 #7

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

Similar topics

5
13370
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL http://mghospedagem.com/images/controlpanel.jpg instead of http://mghospedagem.comhttp://mghospedagem.com/images/controlpanel.jpg As u see, there's the website URL before the image URL.
0
8662
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9244
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9004
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8961
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4421
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4679
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2439
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2058
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.