PDA

View Full Version : <body onload"......>


CrUdE
02-01-2003, 07:52 PM
yo peeps,

i allready used following code to open a link in a new window with specifications , but how can i use it , that when my index.htm loads, a new window pops up with the site in it.

A fixed 800*600 window.

What do i need to enter in the body tag???

this is the JS i used:

<script language="javascript">
function newWindow(url,w,h,l,t)
{
var now, title, top, left, options

now = null;
title="info";
top=(screen.availHeight - h)/4;
left= (screen.availWidth - w)/6;
if (top < 0) {top = 0;}
if (left < 0){left = 0;}
options = "width="+ w + ",height="+ h +",left="+ left +",top="+top+",location=no,scrollbars=no,directories=no,status=yes,menubar=no,resizeable=no";
window.open(url,title,options)
}
</script>

Borgtex
02-01-2003, 07:57 PM
:confused: the answer is in your own question...

<body onload="newWindow('thepage.htm',800,600,0,0)">

redhead
02-01-2003, 07:59 PM
umm... dont open an 800*600 window... me and my fellow 800*600ites would immediately give it the ALT+F4 treatment... perhas 650*450 would be more friendly?

CrUdE
02-01-2003, 08:11 PM
ok, found my fault, putted the <body onload"javascript:newWindow....

i'd to left out the javascript part . tnx m8


@ redhead

What do u mean exactly, with the alt F4 thing ?? why is 640*480 more friendly??

Just asking 'coz i don't get it

CrUdE
02-01-2003, 09:37 PM
okay everything works fine now, but i have one more question.

Is it possible that when my site window pops up the original window closes after a couple of seconds?

What i mean is, is it possible to put 2 functions in the onload funtion?

pardicity3
02-01-2003, 10:07 PM
Yep, you can do two functions at once, just seperate them with a semicolon ( ; ).

<body onload="newWindow('thepage.htm',800,600,0,0); functionThatClosesWindow();">

klearcut
04-03-2003, 10:24 PM
Can you put a semicolon to seperate scripts on an onsubmit=?

ie

<td height="35"><form name="CheckForm" method="post" onsubmit="return checkCheckBox(this); return checkform(this);" action="sendcheck.asp">

thx