show the code for the popup.
Cd&
Main Topics
Browse All TopicsWhen clicking on a photo, I have a customized popup that let's you zoom in/out on the image. While zooming in and out, I am using the javascript window.resizeTo( )function to grow/shrink the window to match the photo size. Since I have been testing this on the webserver computer, I never noticed a problem before.
Internet Explorer is a requirement for the application as of now, and therein lies the problem.
When accessing this popup from another computer(not the server), I get an access denied error everytime I try to call the window.resizeTo( ) function. The window resizing all takes place in the popup window itself, so I'm not sure exactly why access would be denied.
Could an expert please clarify this or tell me what i'm doing wrong?
Also, if it's impossible to use the resizeTo( ) function, is there another way to get the same functionality?
As of now, on the popup, you click a zoom button, which in turn calls a javascript function which increases the size of the photo and the window.
Thanks :)
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Ok, here's some of the code. I am doing an onload the first time for the initial sizing. However, zooming is done through javascript functions:
Don't mind the weird calculations...
I've basically stripped the code down since there was a lot of jsp in it.. so hopefully it works. You can basically get the gist of my question by looking at the zoom_in( ) function since this is where the problem is occuring.
As you can see, I'm initially setting the image size using the <body onload="">, however after this point, I would still like to be able to zoom in to the picture while the window resizes.
<script language="javascript">
var time_length=1;
var step=10;
var original_time=time_length;
var starting_width;
var starting_height;
function zoom_in()
{
for(i = 0; i < document.images.length; i++) {
document.images[i].width+=
}
if(document.images[0].widt
width = document.images[0].width+4
else
width = starting_width;
if(document.images[0].heig
height = document.images[0].height+
else
height = starting_height;
if(width > screen.width)
width = screen.width;
if(height > screen.height)
height = screen.height;
window.resizeTo(width, height); // <<-------- Access Denied on this line.
setTimeout("zoom_in()",tim
}
function resume_zoom()
{
time_length=original_time;
}
function pause_zoom()
{
time_length=10000000000;
}
function initialResize()
{
starting_width=document.im
starting_height=document.i
window.resizeTo(starting_w
}
</script>
<BODY link="#251694" Vlink="#251694" alink="#800000" style="background-color:wh
<table width="100%" cellspacing=0 cellpadding=0 border=0 height="100%">
<tr><td height="3"></td></tr>
<tr>
<td width="1"></td>
<td bgcolor="gray" style="border: solid 2px #000000;">
<table width="100%" cellspacing=0 cellpadding=0 border=0>
<tr>
<!--BEGIN ZOOM LINKS-- only one here... removed the rest for simplicity-->
<td align=left valign="top" bgcolor="gray" width="100%">
<table cellspacing="3" cellpadding="3" align="left">
<tr>
<td style="border:2 solid #000000" align="middle" bgcolor="white" nowrap>
<a href="#" onMouseDown="javascript:re
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="100%" align="center" valign="middle" colspan="100%">
<div id="pictureDiv" class="maindiv" STYLE="overflow:auto; height:100%; width:100%; background-color:white;">
<table width="0" cellspacing=0 cellpadding=0 height="100%">
<tr>
<td align="center" valign="middle">
<img src="blah.gif" border=1 width=350 style="border-color:black"
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
</table>
</BODY>
-- Thanks for the quick response :)
Another quick comment:
I believe this only happens with the latest version of IE.
3/4 computers in my office, including the server, can all use the popup perfectly. However, there is one computer that has a different set of version 6.0 IE updates than the rest, so we think that computer has had the latest update performed to it. It is also the only one that can't increase the size of the window.
I have also read on other forums that in the latest microsoft security fix, access was denied to the resizeTo functionality.
I would be surprised if they've made this functionality impossible to implement.
SEE THIS http://windowsxp.mvps.org/
and i just checked in windows 2000 server and IE version 6.0 IT WORKS FINE
IE6 on xp with SP2 installed; restricts the dynamic use of most window methods, and part of the new M$ security look. Once you are past the load event many of the window methods will cause an error. I am not sure if that is a bug that is going to be fixed by Microslop, or if it is not part of the reality of trying to work with the tired old patched IE code.
Cd&
Thanks all,
archrajan, yeah, setting the height and width individually didn't do anything. I was really hoping that one would work, haha. 6.0 also has multiple patches. All four of our computers in the office have version 6.0, but only the computer not working has different "update versions" on it compared to the rest of them.
Gwyn, even seeing the clarification on what you said, I still have no clue what it means. I'm wondering if microsoft even knows what it means. haha. I saw it explained like this on another website, but even there they didn't go into details or give an example for what they meant.
Cd&, all of the computers, including the one not working, are windows2k. I'm not sure what service pack it has, but I do know that the "update patches" in the "about IE" are different than the 4 computers that work.
So now that we know there is definitely something causing this function not to work anymore, is there any other way of doing it without using the window.resizeto( ) function? We've been throwing ideas around the office about popping up the window at different sizes as you zoom in, but that just seems like a REALLY bad coding practice. Ack.
Thanks again.
I will wait for one more day of replies before giving points out just in case someone can figure out a work around.
Archrajan, I think I may go with my previous non-enlarging window (unless they enlarge manually) style that I had before if I can't get this to work. GRRR! Cd& is dead on with "Microslop", lol.
Reloading the window for every zoom just wouldn't look professional in my opinion, though we have thought about it. However, the boss has the final say. I'll see what he wants to do before I proceed.
In the meantime, if any experts know of any workarounds for IE that will get the smooth image zooming/window size increase that you can probably see if you're not using the newest IE update, please feel free to post your solutions.
I will still be waiting for tomorrow night to divide the points up.
Thanks again :)
Actually, while we're on the subject of.. "if we can't get this to work"...
Could someone please tell me how to catch an "access denied" error in javascript? I'll add an extra 50 points for this one :).
I definitely don't just want to throw perfectly good code out the window if someone has a browser that can use it, haha ;).
Don't ask me how...
When using the version of IE that doesn't seem to work, plus mplungjan's error check...
You zoom in and see the photo enlarging, but the window size doesn't change. As soon as you let go of the zoom button, the window's size enlarges/shrinks to fit the photo. It seems that there is no error the last time through, so it runs the resize code.
Odd.
Business Accounts
Answer for Membership
by: archrajanPosted on 2005-01-26 at 17:34:25ID: 13148653
may be its improperly seen by IE as an unlawful attempt to script a window that you don't own. In a way, it's right, since the window hasn't been fully constructed yet.
try to put that function in the onload...
post some code