javascript thread: Making the window visible and in focus....
Hi there
I am getting a "Access Denied" error when I click any of the hyperlinks on
the code given below.
<html>
<head>
<script language="javascript">
<!--
function new_window(theURL,winName)
{
var x=window.open(theURL,winName,'toolbar=1 menubar=1 height=640
width=480');
x.focus();
x.moveTo(10,10);
}
-->
</script>
</head>
<a href="javascript:new_window('http://intranet','_new')">Intranet</a><p>
<a
href="javascript:new_window('http://intranet/training/log.asp','_new')">Log<
/a><br>
</body>
</html>
HELP REQUIRED ASAP.
Gautam
-----Original Message-----
From: Bharat Gautam [mailto:BGautam@q...]
Sent: Monday, January 21, 2002 6:04 PM
To: javascript
Subject: [javascript] Re: Making the window visible and in focus....
Thanks
-----Original Message-----
From: Chris Scott [mailto:chris@e...]
Sent: Monday, January 21, 2002 2:08 PM
To: javascript
Subject: [javascript] Re: Making the window visible and in focus....
> I want the window to appear maximized on
> screen whenever its content ( the page it is displaying changes).
> function new_window(theURL,winName,features)
> {
> window.open(theURL,winName,features);
> window.focus(winName);
> }
I think the following should do the trick...
function new_window(theURL,winName,features){
var myWindow=window.open(theURL,winName,features);
myWindow.focus();
myWindow.moveTo(0,0);
myWindow.resizeTo(parseInt(screen.availWidth),parseInt(screen.availHeight));
}
HTH,
Chris