D. Alvarado wrote:
Hello,
Just wanted to check if this was possible. I have n blocks of text
and I would like each to pop up in a window. Hoever, I don't want to
create n different HTML pages and invoke each one through window.open.
Is there some way I can call window.open and pass the text to it and
have that text appear in the popup window? Styling is not important.
I don't care if the text just appears in plain font.
Thanks -
How about this approach? If you like this, you can make the window any
size, with or without scroll bars, and you can make it appear centered.
Once you get started post your code and you can get specific help for
any features you want to work on.
Mike
<html>
<title>CodeAve. com(JavaScript New Window within Previous Page)</title>
<body bgcolor="#FFFFF F">
<script language="JavaS cript">
<!--
function open_new_window () {
new_window = open("","displa yWindow","width =575,height=290 ,left=10,top=10 ");
// open new document
new_window.docu ment.open();
// Text of the new document goes here
// Replace your " with ' or \" or your document.write statements will fail
new_window.docu ment.write("<ht ml>");
new_window.docu ment.write("<he ad>");
new_window.docu ment.write("<me ta http-equiv='Content-Type'
content='text/html; charset=windows-1252'>");
new_window.docu ment.write("<ti tle>Table of Data</title>");
new_window.docu ment.write("<st yle type='text/css'>");
new_window.docu ment.write(" td { text-align: right; }");
new_window.docu ment.write(" td.1 { text-align: left; }");
new_window.docu ment.write("</style>");
new_window.docu ment.write("</head>");
new_window.docu ment.write("<bo dy>");
new_window.docu ment.write("<ta ble border='1' cellspacing='1' width='555'
height='246' style='border-collapse: collapse'>");
new_window.docu ment.write(" <tr>");
new_window.docu ment.write(" <td class = '1' width='111'>Son nenstand
in Grad über dem Horizont ein<br>Elevatio n of the sun (degrees above the
horizon</td>");
new_window.docu ment.write(" <td class = '1' width='111'>Opt imaler
Anstellwinkel des Spiegels °A<br>Optimal mirror orientation °A</td>");
new_window.docu ment.write(" <td class = '1'
width='111'>Ene rgieerzeugung Watts<br>Power output Watts</td>");
new_window.docu ment.write(" <td class = '1' width='111'>Mit der
erzeugten Energie können Sie Grams<br>With the above displayed energy
you can heat Grams</td>");
new_window.docu ment.write(" <td class = '1' width='111'>con verted to
lbs:</td>");
new_window.docu ment.write(" </tr>");
new_window.docu ment.write(" <tr>");
new_window.docu ment.write(" <td>0°</td>");
new_window.docu ment.write(" <td>60°</td>");
new_window.docu ment.write(" <td>138,56 W</td>");
new_window.docu ment.write(" <td>552 g</td>");
new_window.docu ment.write(" <td>1 lb 3.5 ozs</td>");
new_window.docu ment.write(" </tr>");
new_window.docu ment.write("</table>");
new_window.docu ment.write("</body>");
new_window.docu ment.write("</html>");
// close the document
new_window.docu ment.close();
}
// -->
</script><a onclick="open_n ew_window()"
style="cursor:p ointer;cursor:h and;" ><font color="#008080" ><u>Open New
Window</u></font></a>
</body>
</html>