displaying php content in JavaScript new window
<p>Here is the code that I have so far: </p>

<pre><code>$output = &lt;&lt;&lt;BLOCK

    &lt;html&gt;
        &lt;head&gt;
            &lt;title&gt;Preview!&lt;/title&gt;

            &lt;script type="text/javascrit"&gt;
                var content = $data;
            &lt;/script&gt; 

        &lt;/head&gt;
        &lt;body&gt;
            &lt;a href="" onclick="preview()"&gt;Click Me!&lt;/a&gt;
            &lt;script type="text/javascript"&gt; 
                function preview(){
                    var preview = window.open('','preview','scrollbars=1,height=500,width=500,resizable=1');
                    preview.document.open();
                    preview.document.write(content);
                    preview.document.close(); 

                }
            &lt;/script&gt; 
        &lt;/body&gt;
    &lt;/html&gt;     
BLOCK;
echo $output;   
</code></pre>

<p>$data contains a full html document generated by the php script.  </p>

<p>This doesn't seem to work, but I think you can get the idea what I'm trying to do.  Your help is appreciated.  Thanks. </p>
