ReferenceError: chunks is not defined
<p>The following code tries to injuect some code into an iFrame (on the same server as the page). I am getting a <strong>ReferenceError: chunks is not defined</strong> error. Can somebody help me figure out why please? I've been baning my head on this one for a day now.</p>

<pre><code>&lt;iframe id="preview-iframe"&gt;&lt;/iframe&gt;

&lt;script language="JavaScript" type="text/javascript"&gt;
var chunks;
chunks += "&lt;span class=\"bold";
chunks += "\"&gt;Hello World!&lt;/";
chunks += "span&gt;";
document.getElementById("preview-iframe").src="javascript:void(document.write(chunks))";
&lt;/script&gt;
</code></pre>
