How to embed javascript code dynamically into HTML
<p>We have a requirement, where a javascript needs to be rendered dynamically when the HTML page is rendered. The javascript function could be used to draw a circle or triangle or a square. Assuming the following code snippet is stored in a certain field in the database, how do you embed such code directly into HTML at a certain location.</p>

<pre><code>&lt;script src="../js/processing.js"&gt;&lt;/script&gt;
&lt;script src="../js/shapes.js"&gt;&lt;/script&gt;

&lt;div style="clear:both;"/&gt;
&lt;canvas id="canvas1" width="200" height="200"&gt;&lt;/canvas&gt;

&lt;script id="script1" type="text/javascript"&gt;
var sketch = new Processing.Sketch();
sketch.attachFunction = function(processing) {
processing.setup = setup(processing);
processing.draw = drawCircle(processing);
};

var canvas = document.getElementById("canvas1");
var p = new Processing(canvas, sketch);
&lt;/script&gt;
</code></pre>
