PDA

View Full Version : Resolution & Popup window problem.


skronken
02-04-2006, 11:20 PM
Hey. I have combined two scripts that I found on the wildweb( :rolleyes: ).
Bu they don't work. Can you help me locate the errors?



<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by: Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web URL: http://fineline.xs.mw -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "',

'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=1024,height=768,left = 64,top = 48');");
}
// End -->
</script>

<SCRIPT LANGUAGE="JavaScript1.2">
<!-- Begin
if (screen.height >= 768 && screen.width >= 1024) {
window.location="javascript:popUp('index.php')";
}
else {
window.location="index.php";
}
}
// End -->
</script>

MetalStorm
02-05-2006, 12:08 AM
There's an extra curly bracket at the end. :)

Also, new variables should have var before them and using location.href to call the JavaScript function isn't really necessary.

<script type="text/javascript">
<!-- Idea by: Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web URL: http://fineline.xs.mw -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
var day = new Date();
var id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "','toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=1024,height=768,left = 64,top = 48');");
}
// End -->
</script>

<script type="text/javascript">
<!-- Begin
if (screen.height >= 768 && screen.width >= 1024) {
popUp('index.php');
}
else {
window.location="index.php";
}

// End -->
</script>