Why won't my javascript work?
<p>Here's my javascript code (backslashes are for escaping):</p>

<pre><code>&lt;script type="text/javascript"&gt;
        $(function(){
            //datepicker
            $(\'#start\').datepicker({
                inline: true
            });
        });
&lt;/script&gt;
</code></pre>

<p>And the relevant HTML:</p>

<pre><code>&lt;input type="text" name="start" id="start" class="hasDatepicker" /&gt;
</code></pre>

<p>It's essentially identical to the example code that comes with jquery and jquery ui. I'm thinking it could be that everything is appended to a variable called $content and echoed out at the end instead of simply being HTML.</p>

<p>I appreciate any answers to this conundrum.</p>

<p>I should perhaps have been more visual about how my code is set up instead of explaining it at the end. This is generally how it looks:</p>

<pre><code>$content .= '&lt;script type="text/javascript"&gt;
        $(function(){
            //datepicker
            $(\'#start\').datepicker({
                inline: true
            });
        });
&lt;/script&gt;';
</code></pre>

<p>My HTML is similarly added to $content:</p>

<pre><code>$content .= '&lt;input type="text" name="start" id="start" class="hasDatepicker" /&gt;';
</code></pre>
