PDA

Click to See Complete Forum and Search --> : little question


Anonymona
May 1st, 2002, 09:31 AM
How do I make a pop-up window (using html)?


Thanks! :)

punkpie_uk
May 1st, 2002, 10:08 AM
You use a client side language such as javascript.


<script language="javascript" type="text/javascript">
function openWin(){
window.open('new','page.htm');
}
</script>

Anonymona
May 1st, 2002, 10:17 AM
How do I do that in this kind of a tag:

<AREA SHAPE=RECT COORDS="154,489,190,550" HREF="otherpage.html" TARGET="_blank" ALT="BRN 70" OnMouseOut="window.status=''; return true" OnMouseOver="window.status='BRN 70'; return true">

(i.e. instead of using href)

Anonymona
May 1st, 2002, 10:34 AM
never mind, solved that one.. :)

but can anyone help me with this other problem? ;)
how do i pass a variable from this tag (the one in my reply) to the pop-up window?


thanks!

CiberTHuG
May 1st, 2002, 10:51 AM
JavaScript passes variables the same way most modern languages do. JavaScript's syntax is based on Java, which in turn is based on C/C++, which in turn.... Perl, JScript, VB, Fortran, and a host of other languages pass variables in the same way.


<html>
<head>
<title>Test Page</title>
<script type="text/javascript">
function myFunction (myVar) {
alert(myVar);
}
</script>
</head>
<body>
<p onclick="javascript:myFunction('Foo');">Click Me!</p>
</body>
</html>

punkpie_uk
May 1st, 2002, 11:21 AM
You write to a document using document.write


<script language="javascript" type="text/javascript">
function openWin(){
newwin=window.open('new','page.htm');
newwin.document.write('Something');
}
</script>

Anonymona
May 1st, 2002, 02:18 PM
no no,.. that's not what i meant.. i know how to pass it to a function on the same page, and i don't want to write it to another page, i need to pass it to the pop-up window (which is a separate page).. how do i do that?