views:

15

answers:

0

I am trying to resize the window in IE. For this, I am using

window.resizeBy(width - document.documentElement.clientWidth, height - document.documentElement.clientHeight);

However, sometimes this fails with an "Access is denied" exception. The way I was handling this was just to use

setTimeout('resizeWindow(' + width + ', ' + height + ')', 200);

if the exception occurs to try again a little later.

The trouble is it is now causing a race condition if the window needs to be re-sized several times in quick succession.

Does anyone know why the "Access is denied" exception might be being thrown and how to avoid it?