Garyon

Just as the subject says. When I attach an event to the window.onresize handler in IE7, when the page is loaded it enters into an infinte loop ... firing the event handler over & over.

I REALLY need this resize method to work for managing an application UI.

Is anyone familiar with this

I am using the following doctype ... in case that matters ...

DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" http://www.w3.org/TR/html4/strict.dtd

- Gary Stenstrom



Re: Internet Explorer Web Development window.onresize in IE7 causes infinite loop on window.onload

JamesRV

I'm having precisely the same problem, and using the strict doctype as well. Firefox has no such problem. Can anyone offer assistance

Thanks very much.




Re: Internet Explorer Web Development window.onresize in IE7 causes infinite loop on window.onload

Zolaerla

This is a flaw or bug in IE7. I have run across the same problem, and spent three hours nailing it down. Here it is as far as I can tell:

IE7 improperly fires off a 'Browser Resized' event when the first dynamically generated content region is made visible. What I mean by 'the first', is the first one that appears throws this event. I say 'dynamically generated content REGION', because it doesn't happen to inline content, only content generated by javascript. To make things worse, I haven't been able to make a simplified test case for this so I don't know if my explanation is 100% accurate, but I *HAVE* found a work around.

Work Around: In my case, I do everything through an onload event. In the onload event, BEFORE everything else, I simply created a new floating content region with nothing in it. It looks like:
newobject = document.createElement('DIV');
if (newobject) {
newobject.id = 'blankregion';
newobject.style.position = 'absolute';
newobject.style.visibility = 'visible';
newobject.style.display = 'block';
newobject.innerHTML = ' ';
document.body.appendChild(newobject);
}

This simply creates a blank floating   out there on your page, BUT it seems to prevent the onresize events from being fired off over and over. It worked for me, I hope it helps you guys out too.