Dynamic iframe in a Pop up Window
<p>I am trying to achieve 2 things with the href links below. First, I would like to fire-up a pop up window. Done. Next, I would like that pop up window to display an iframe. This was easily accomplished as well <strong>until</strong> I realized I needed to pass the href link text as a parameter in my iframe src. </p>

<p>So for example, the iframe wont load in my pop up window unless its <code>src="http://localhost:8080/test/document.html?OnSale"</code></p>

<p>I cannot figure out why the <code>document.write</code> in the body of my html page won't print out the dynamic iframe Im trying to create with my foo() function in the href links...</p>

<pre><code>&lt;div id="blanket" style="display:none;"&gt;&lt;/div&gt;
    &lt;div id="popUpDiv" style="display:none;"&gt;
        &lt;a href="#"  onclick="popup('popUpDiv')"&gt;
            &lt;img align="right" src="http://localhost:8080/test/img/close_img.png"&gt;
        &lt;/a&gt;
&lt;script type="text/javascript"&gt; 
                function foo(obj){
                test1 = "http://localhost:8080/test/document.html?"+obj.text; 
                document.write('&lt;iframe height="450"  allowTransparency="true" frameborder="0" scrolling="yes" style="width:100%;" src="'+test1+'" type= "text/javascript"&gt;&lt;/iframe&gt;');
                } 
&lt;/div&gt;

&lt;a href="#" onclick="popup('popUpDiv');foo(this);"&gt;OnSale&lt;/a&gt;
</code></pre>

<p><strong>EDIT:</strong>
Here is my full html page. Everything is running locally on tomcat7 w/ win7 and firefox.</p>

<pre><code>    &lt;html&gt;
    &lt;head&gt;
    &lt;script type="text/javascript" src="http://localhost:8080/test/css-popup/css-pop.js"&gt;&lt;/script&gt;
    &lt;link href="http://localhost:8080/test/css-popup/styles.css" rel="stylesheet" type="text/css" /&gt;
    &lt;/head&gt;
    &lt;body&gt;


    &lt;div id="blanket" style="display:none;"&gt;&lt;/div&gt;
        &lt;div id="popUpDiv" style="display:none;"&gt;
            &lt;a href="#"  onclick="popup('popUpDiv')"&gt;
                &lt;img align="right" src="http://localhost:8080/test/css-popup/x.png"&gt;
            &lt;/a&gt;
    &lt;script type="text/javascript"&gt; 
                    function foo(obj){
                    test1 = "http://localhost:8080/test/document.html?"+obj.innerHTML; 
                    document.write('&lt;iframe height="450"  allowTransparency="true" frameborder="0" scrolling="yes" style="width:100%;" src="'+test1+'" type= "text/javascript"&gt;&lt;/iframe&gt;');

                    } 
&lt;/script&gt;
    &lt;/div&gt;

    &lt;a href="#" onclick="popup('popUpDiv');foo(this);"&gt;OnSale&lt;/a&gt;

    &lt;/body&gt;
    &lt;/html&gt;
</code></pre>
