Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maximize Window "Access is Denied Error" 1

Status
Not open for further replies.

MadTown

Programmer
Jun 5, 2001
81
US
I'm fairly new to javascript. I have a web intranet application that calls my maxwindow function in the body's onload
Code:
<body onload="maxWindow('')">

The page initially loads fine but when you go back to the page by the back button or refresh an "access is denied" error alert pops up. Below is the code for the function
Code:
function maxWindow(lEdit)
{
if (lEdit =="NoEdit") {
   alert('Unable to edit Record is locked by another user');
}
self.moveTo(0,0);
self.resizeTo(screen.width,screen.height);
	
}

The error points to the self.moveto(0,0) line. This error happens in IE 6, I haven't tested in Netscape etc, because everyone who is accessing the app should be using IE.

Is it possible to determine if it is already at 0,0 and skip over that line.

Thanks in advance for any help
 
Hmm, my guess (and I could be totally wrong) is that when you click the back button the script is ran from the local cached copy of the page. Since that's in a different domain from where the page came from, that might be why you're getting the access denied error. Try disabling the cache on the page so the script is always pulled from the server.

Here's how to do it:

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
Adam,
Thanks!!

You were right on the money.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top