How do I make a pop-up window (using html)?
Thanks! :)
Printable View
How do I make a pop-up window (using html)?
Thanks! :)
You use a client side language such as javascript.
Code:<script language="javascript" type="text/javascript">
function openWin(){
window.open('new','page.htm');
}
</script>
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)
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!
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.
Code:<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>
You write to a document using document.write
Code:<script language="javascript" type="text/javascript">
function openWin(){
newwin=window.open('new','page.htm');
newwin.document.write('Something');
}
</script>
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?