Okay, obviously I know how to open a pre-sized window, and how to turn off the scrollbars, etc.
However, I am curious if there is a simple way to pre-fill that window with content. Rather than saving a separate file with the content that I want displayed, is there an easy way to make the window open, and then load content specified by the page that opened that window.
Here is the code I've tried (from Googling this type of thing), but it doesn't seem to do anything:
In the Head
Code:
<script language="JavaScript1.2" type="text/javascript">
<!--
function open_help ( help_title, help_text ) {
help_win = window.open( "", "help", "width=300, height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=auto");
help_win.document.write('<html><head><title>' +help_title+ '</title></head>');
help_win.document.write('<body style="background-color:#fff;color:#000;">');
help_win.document.write('<b>' +help_title+ '</b>');
help_win.document.write(help_text);
help_win.document.write('</body></html>');
-->
</script>
In the body:
Code:
<a href="#" onClick="javascript:open_help('Entering Page Content','You may type essentially anything you want in the textarea above. You may use HTML code. The buttons above the textarea will generate XHTML transitional code.
<br />However, if you choose more than one style option, you should remove the unnecessary code. For example, if you choose a font-face, and then you choose a font-size, the following code will be generated:
<br /><pre><div style=font-family:Verdana;><div style=font-size:10;></div></div></pre>
<br />You should edit that code to make it look like this:
<br /><pre><div style=font-family:Verdana;font-size:10;></div></pre>
<p />In addition, if you want your page to meet XHTML Transitional and CSS requirements, then you will need to add either sans, serif, or monotype to each font-family style choice. For instance, if you choose Verdana from the list of fonts, the following code will be generated:
<br /><pre><div style=font-family:Verdana;></div></pre>
<br/>You should add sans to that font-family tag, like this:
<br /><pre><div style=font-family:Verdana,sans></div></pre>')">Open Help</a>
I've tried the same type of code with less content to see if maybe that was the problem. It still didn't do anything. Is there a simple way to specify the content of a pop-up window within the parent window?