Link to home
Start Free TrialLog in
Avatar of dentonsy
dentonsy

asked on

window.resizeTo generates "Access is denied" error ONLY after moving the scrollbar

I am using window.resizeTo to do resizing. This works fine as long as I don't touch/move the scrollbar. But as soon as I do and then try to resize the window again, I get "Access is denied". Any idea what is causing this? It is very weird.

To make my problem simple, I created a simple html page to demonstrate the problem:
<head>
<script type="text/javascript">
function setsize(w,h) {
window.resizeTo(w,h);
}
</script>
<title>resize test</title>
</head>

<body>
resize test
<br><br>
<form>
<select onChange="setsize(600,400)">
      <option>option 1</option>
      <option>option 2</option>
</select>
</form>
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
<br>
TEST
</body>

Here are the steps:
1. Open the html page in IE browser. I am using IE 6.0.2800.1106
2. Choose any option in drop down. It will always resize to 600x400. The resizing works fine at this point.
3. Move the scrollbar around a little bit.
4. Trying resizing again gives "Access is denied" javascript error and window does not resize.

Please help. Thanks.
Denton
Avatar of trevorhartman
trevorhartman
Flag of United States of America image

this seemed to work for me:

function setsize(w,h) {
window.scrollTo(0,0);
window.resizeTo(w,h);
}

not sure why its giving an access denied.  could just be a bug

-Trevor
ASKER CERTIFIED SOLUTION
Avatar of Zyloch
Zyloch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think Zyloch is right, looks like a bug in IE that will need to be fixed via a patch from Microsoft.

Trevor, still didn't fix it, if you move the scrollbars before using the select box, it still outputs the error.

Regards...
hi,

when you're using IE at the and of the function use
return false;

in Netscape use
return true;

like this:

window.resizeTo(350,450);
return false

cheers!
 dave
Avatar of a_twixt_in_the_tale
a_twixt_in_the_tale

No problem here too...
Try a lil delay bfr calling setsize(600,400) using setTimeout

:)
Don
Avatar of dentonsy

ASKER

The solution scrollTo and "return false" still doesn't fix the problem. I tried the setTimeout method but it just delayed the "Access is denied" error.

Don, can you post your exact solution (codes) here? Thanks.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the link, Dave. But I don't think the .exe files are working. My IE version is 6.0.2800.1106 and this corresponds to the SP1 download. But upon executing the downloaded exe file, it says "This update requires IE 6 SP 1 to be installed." It's happening both in my computer at home and at office... Have you tried installing the patch?
actualy I have never had such a problem before... I was just following my insticts to assist you... you did not try these updates did you? that update was issued in early 2004, some people still have updates that are outdated and surprisingly they are all in SP1
Well, my IE version is this: 6.0.2800.1106.xpsp2.030422-1633
Exactly the same as mine. Have you tried installing the patch, Zyloch?
let's check Update Versions, mine is:

Q837009; Q832894; Q81167; Q823353; Q867801


if you don't have Q867801 you MUST install this:

http://www.microsoft.com/technet/security/bulletin/ms04-025.mspx
to see what they represent go to this website and check all of them by putting them into search box

http://search.microsoft.com/search/results.aspx?view=en-us&st=b&na=82&qu=Update+version+Q867801
updates are same as Patches. here check this out this is the site for latest IE Patch

http://www.nwfusion.com/news/2004/0730mspatch.html

if you look down on this site you'll see a link:
Advertisement: The patch is available here.

you click that link and it' will take you to the Microsoft website to the Q867801 which is the same that I provided in the above comment, but anyway, if you install this patch and realize it did not solve your issue, I would recommend to install all the updates (Q837009; Q832894; Q81167; Q823353; Q867801) to find out where they are follow my link posted in comment: Date: 08/12/2004 06:28AM PDT

cheers!
 dave



I would also reccommend to turn on windows automatic updates, in couple of days windows XX SP2 will become available and you don't wanna miss it
http://www.microsoft.com/athome/security/protect/default.aspx
My Update Versions are currently: SP1; Q330994; Q824145; Q832894; Q837009; Q831167; Q823353; Q867801

But the "Access is denied" error still persists. This is not happening in any other browsers. I guess IE just messed it up with its own fixes ;)
A perfect reason to scrap IE and migrate to another browser :) [now if we could only convince the general community of that...]

I mean, besides the fact that the blue of IE is really getting to me.
Well, I guess there's no solution with IE... so I'll just split up the points between Zyloch and David.