Question

resizeTo -- Access Denied -- IE

Asked by: autoknowledge

When 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.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2005-01-26 at 17:26:36ID21290299
Tags

denied

,

access

,

javascript

,

resizeto

Topic

JavaScript

Participating Experts
4
Points
350
Comments
20

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

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.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

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.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

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.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. resizeTo(x, y) yields different results than open(url, …
    I'll bet this one will be real easy for someone here. If I do this: window.open(url, "name", directories=no, menubar=no, toolbar=no, fullscreen=no, scrollbars=yes, resizable=yes, width=650, height=450) in IE 6, the window I'm getting is 662 by 481, not 650 by 4...
  2. Access denied in JavaScript resizeTo command
    Given the following: <script language="JavaScript"> function openWins() { w = window.open("http://ksny2k08:8080/RptPickTicket.jsp"); alert("Before"); w.resizeTo(screen.width-2,screen.height-2); alert("After"); w.moveTo(0,0); }...
  3. Zoom in photo question
    Hi, Experts, I would like to make a project that I can zoom in a regular size photo. For example, if I have a 300 by 100 photo and I would like to be able to click anywhere on it and show a large version ( or zoom in detail ) of photo beside. ( Maybe zoom in on another large...
  4. Zoom in photo question
    Hi, Experts, I have this file that I am working on and it is not working. I try to change every way I can and still not working. I would like to ask how to make it works ? and please just change the code only Here is the files -- >> http://f2.pg.briefcase.yahoo.com/bc/...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

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.

Join the Community

Answers

 

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

 

by: COBOLdinosaurPosted on 2005-01-26 at 17:35:04ID: 13148665

show the code for the popup.

Cd&

 

by: autoknowledgePosted on 2005-01-26 at 18:15:59ID: 13148904

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+=step;
     }

    if(document.images[0].width >= starting_width-32)
      width = document.images[0].width+40;
    else
      width = starting_width;

    if(document.images[0].height >= starting_height-113)
      height = document.images[0].height+140;
    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()",time_length);
}

function resume_zoom()
{
 time_length=original_time;
}

function pause_zoom()
{
 time_length=10000000000;
}

function initialResize()
{
  starting_width=document.images[0].width+40;
  starting_height=document.images[0].height+140
  window.resizeTo(starting_width,starting_height);
}

</script>

<BODY link="#251694" Vlink="#251694" alink="#800000" style="background-color:white" marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 onload="initialResize();">

<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:resume_zoom();zoom_in();" onMouseUp="javascript:pause_zoom();" onMouseOut="javascript:pause_zoom();" style="font-family:verdana,arial,helvetica; font-weight:bold; font-size:10pt; color:#003399; text-decoration:none"><font color="#000000">Zoom In</font> +</a>
                </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 :)

 

by: autoknowledgePosted on 2005-01-26 at 18:24:53ID: 13148939

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.

 

by: archrajanPosted on 2005-01-26 at 18:42:31ID: 13149030

yeah.... it works perfectly fine in mozilla firefox..
guess this is a IE only bug...

 

by: archrajanPosted on 2005-01-26 at 18:43:42ID: 13149034

Though u replace the line which gives error with
window.width = width;
 window.height = height

it does not give the error.. but its not what u expect to do

 

by: archrajanPosted on 2005-01-26 at 18:51:56ID: 13149074

SEE THIS http://windowsxp.mvps.org/ie/resizeiehome.htm
and i just checked in windows 2000 server and IE version 6.0 IT WORKS FINE

 

by: GwynforWebPosted on 2005-01-26 at 19:39:46ID: 13149267

The popup belongs to the opening page not the page in it, if the popup is from a different server then it can not resize the popup.

 

by: GwynforWebPosted on 2005-01-26 at 21:42:23ID: 13149788

more sccurately shld read "if the in the popup is from a different server then it can not resize the popup."

 

by: GwynforWebPosted on 2005-01-26 at 23:16:31ID: 13150114

oh dear still not right I mean "if the page in the popup is from a different server then it can not resize the popup."

 

by: mplungjanPosted on 2005-01-27 at 02:22:44ID: 13150877

The script is in the page so the script is not from a different server?!?!

 

by: GwynforWebPosted on 2005-01-27 at 06:21:06ID: 13152419

....are you sure.

 

by: COBOLdinosaurPosted on 2005-01-27 at 07:46:12ID: 13153416

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&

 

by: autoknowledgePosted on 2005-01-27 at 17:49:42ID: 13159406

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.

 

by: archrajanPosted on 2005-01-27 at 18:53:15ID: 13159666

the resize to works onload...
so one way will be to
when they click zoom we cud refresh the page and have an onload function which wud grab the height and width may be from the query string and resize again...
will u be interested in a solution like this???

 

by: autoknowledgePosted on 2005-01-27 at 22:17:19ID: 13160445

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 :)

 

by: autoknowledgePosted on 2005-01-27 at 22:20:01ID: 13160453

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 ;).

 

by: mplungjanPosted on 2005-01-27 at 22:52:21ID: 13160557

try {
  window.resizeTo(bla,bla)
}
catch (e) {
  if (e.description.indexOf('access') !=-1) alert('Drat')
  else alert(e.description)
}

 

by: autoknowledgePosted on 2005-02-07 at 14:15:13ID: 13249366

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.

 

by: autoknowledgePosted on 2005-02-07 at 14:17:02ID: 13249391

I'm just dividing the points up since there was no way to completely solve the problem.  Mplungjan gets 50 for answering my last question.

Thanks all.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...