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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

moveTo()

Status
Not open for further replies.

jay25

MIS
Jun 17, 2002
16
US
I've been trying to open a new window and move it toward the center. It will not move and I get an error. What am I doing wrong? Thanks.
Code:
<html>
<head>
<script language=&quot;JavaScript&quot;>
function newwin() {
childWin=window.open(&quot;[URL unfurl="true"]http://www.google.com&quot;,&quot;&quot;,&quot;width=400,height=300,resizable=1&quot;);[/URL]
childWin.moveTo(100,100);
}
</script>
</head>
<body><font size=&quot;4&quot;>
<a href=&quot;javascript:newwin()&quot;>Google</a>
</body>
</html>
 
No, that wasn't it. Now it won't open the window at all and I still get an error. But thanks.
 
Code:
<script type=&quot;text/javascript&quot;>
function newwin() {
childWin=window.open(&quot;[URL unfurl="true"]http://www.google.com&quot;,&quot;&quot;,&quot;width=400,height=300,resizable=1,top=100,left=100&quot;);[/URL]
}
</script>
That opens the new window right at the correct position.
bluebrain.gif
blueuniment.gif
 
Thanks. It works fine. I just couldn't figure out why the moveTo() method will only work with relative URL
 
For security reasons... Many functions are disabled if the URL is not relative.

What if you used frames to steal passwords? Things like that are prevented by the security methods used.
bluebrain.gif
blueuniment.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top