July 28, 2001

Pop Up Windows continued...

So, did the tutorial tell you everything you need to know? Probably not. It took me a few times to get it to sink in.

Ok, at the core of what we are trying to do is the "window.open" command in Javascript. How we're going to use it is in a "function" (ie. a script defined with a name and given a specific task to do). Not to reiterate all the basics of putting together a script (you usually put it in the "HEAD" section of the web page), let's start building our script.

I'm going to name this function "openWindow" (for obvious reasons) and we're going to pass a variable to the function, named "getURL" - why? So we can reuse the function and define what page we want to open on each occasion. In addition, we're going to define the size of the window in height and width.


<script language="javascript">

function openWindow(getURL)

{
window.open(getURL,'WindowName',
'width=400,height=300,
scrollbars=yes,menubar=no');
}

</script>


more to follow...