Re: "Access is denied" using dhtml - window.moveTo( 0, 0);

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi again!

The answer of your question is that it is already on the desktop.

I have done some more testing and this is what I have come up with.
I have a web page called www.dn.se (swedish newspaper) as the browsers
default startup page and it seems like the error "Access is denied" only
occurs (not always) then I have wisited this site (done some clicking) and
then return to my work by entering the address to it in the browsers address
field.
If I start a new browser and halts the load of the default startup page I
have not yet experienced the error "Access is denied" then I try to move the
browser by java code.

This is a very strange error since it seems like there is somthing hanging
on from the www.dn.se site. Is there any way to reset the I.E. browsers
(version 4.01 and up) completely then loading new pages into them?

Thanks, Ardax






"RobB" wrote:

>
> Ardax wrote:
> > Hi!
> >
> > I am trying to move IE to the top left of the screen with the dhtml
> command
> > window.moveTo(0, 0); and then I get the runtime error message "Access
> is
> > denied.". This happens very rarly, about 1 time of 50 but I would
> like to
> > catch this error or be able to check some sort of status flag to see
> if the
> > window.moveTo(0, 0); command is available at that particular point in
> time.
> > The window object is the top window for several underlying frames.
> >
> > The things I have tried is:
> > 1. To make sure that the document.readyState flag have the status
> "complete"
> > for all underlying frames.
> > 2. To set focus to the window by window.focus(); before calling
> > window.moveTo(0, 0);.
> > 3. To use try catch since I am using javascript and it works but not
> for
> > older java versions that also must be able to handle the error.
> > 4. To use window.onerror but it will not fire the event. I have tried
> to
> > create other errors and the event has fired but it will not fire for
> "Access
> > is denied".
> >
> > The solution must work on IE 4.01 and up.
> >
> > Thanks, Ardax
>
> What's the precise scenario involved? Is this a window that has just
> been opened or is already on the desktop? You can do this with 100%
> reliability by putting this function in the same script as the window
> opening code:
>
> function topleft()
> {
> return '<body onload="moveTo(0,0)"></body>';
> }
>
> ....and doing the open like so:
>
> foo = window.open('javascript:opener.topleft()','foo')
>
> This loads the favelet which executes the script; access is guaranteed
> as the process is synchronous, you're just loading a 'document'. You
> can then load a real file using window.open('file.html','foo', '.....)
>
>
.



Relevant Pages

  • Re: get the global object in any environment
    ... Global Object is the window object (despite the fact that it has been ... observed to be in many browsers), ... But this is about unknown environments, ... Yes, as mentioned, I didn't include any feature detection in the example. ...
    (comp.lang.javascript)
  • Re: Accessing the global object
    ... never execute it (and a fair few that know they have it will never execute ... In the context of generalisations about web browsers the single example of a ... falsify the generalisation. ... document.defaultView == window. ...
    (comp.lang.javascript)
  • Re: IE leaks, circular references, addevent et al
    ... knowing whether client does in fact support corresponding events. ... array of such `window` objects? ... Safari due to missing `compatMode` there, ... // Result is ambiguous in all but modern browsers, ...
    (comp.lang.javascript)
  • Re: Password dialog window popping up
    ... It's happening with both Mozilla Firefox and Nestcape browsers. ... This window requests username and password for random odd web addresses. ... As I said, I've never seen these before yesterday, it's been forever since I've seen a popup window at all. ...
    (microsoft.public.security)
  • Re: "Access is denied" using dhtml - window.moveTo( 0, 0);
    ... >> The window object is the top window for several underlying frames. ... To use window.onerror but it will not fire the event. ... >> Thanks, Ardax ...
    (microsoft.public.scripting.jscript)