473,396 Members | 1,898 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,396 software developers and data experts.

<BODY onBlur="resizeTo(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,150)'
onfocus='window.resizeTo(150,300)'>

TIA
Rob
www.rcp.ca

Jul 23 '05 #1
6 7269
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,150)'
onfocus='window.resizeTo(150,300)'>


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.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #2
rob
In message <H7********************@comcast.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,150)'
:>> onfocus='window.resizeTo(150,300)'>
:>
:>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.javascript 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,150)" onfocus="window.resizeTo(150,300)">

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.close" 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.resize" 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.supernews.com>, gr***********@rcp.ca
enlightened us with...

<Body bgcolor='black' Text='#dbdbdb' onblur='window.resizeTo(150,150)'
onfocus='window.resizeTo(150,300)'>


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************************@nntp.lucent.com> - kaeli
<ti******@NOSPAM.comcast.net> writes:
:>
:>In article <11*************@corp.supernews.com>, gr***********@rcp.ca
:>enlightened us with...
:>>
:>> <Body bgcolor='black' Text='#dbdbdb' onblur='window.resizeTo(150,150)'
:>> onfocus='window.resizeTo(150,300)'>
:>>
:>
:>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,150)" onfocus="window.resizeTo(150,300)">

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.supernews.com...
In message <MP************************@nntp.lucent.com> - kaeli
<ti******@NOSPAM.comcast.net> writes:
:>
:>In article <11*************@corp.supernews.com>,
gr***********@rcp.ca
:>enlightened us with...
:>>
:>> <Body bgcolor='black' Text='#dbdbdb'
onblur='window.resizeTo(150,150)'
:>> onfocus='window.resizeTo(150,300)'>
:>>
:>
:>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,150)"
onfocus="window.resizeTo(150,300)">

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.availWidth,
Math.random() * screen.availHeight
);
window.resizeTo(
Math.random() * screen.availWidth,
Math.random() * screen.availHeight
);
}
var t = setInterval('window.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*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #6
rob
In message <zy***************@news2.mts.net> - "Grant Wagner"
<gw*****@agricoreunited.com> writes:
:>
:>"rob" <gr***********@rcp.ca> wrote in message
:>news:11*************@corp.supernews.com...
:>> In message <MP************************@nntp.lucent.com> - kaeli
:>> <ti******@NOSPAM.comcast.net> writes:
:>> :>
:>> :>In article <11*************@corp.supernews.com>,
:>> gr***********@rcp.ca
:>> :>enlightened us with...
:>> :>>
:>> :>> <Body bgcolor='black' Text='#dbdbdb'
:>> onblur='window.resizeTo(150,150)'
:>> :>> onfocus='window.resizeTo(150,300)'>
:>> :>>
:>> :>
:>> :>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,150)"
:>> onfocus="window.resizeTo(150,300)">
:>>
:>> 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.availWidth,
:> Math.random() * screen.availHeight
:> );
:> window.resizeTo(
:> Math.random() * screen.availWidth,
:> Math.random() * screen.availHeight
:> );
:>}
:>var t = setInterval('window.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*****@agricoreunited.com>
:>comp.lang.javascript 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
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.