Most basic javascript templating solution...?
<p>I am looking to create a variable that is a template for repatative elements of my site. I however am only using it infrequently so I do not wish to use a javascript templating engine or library.</p>

<p>I am using jquery... if that effects anyones approach.</p>

<p>This is one of my templates.</p>

<pre><code>$html_template = json_encode("
var html = '&lt;a href=\"javascript:ajax(\'#content\',\'{$conf['dir']['web_url']}profile.php?user_id='+data.id+'\');\"&gt;
&lt;div id=\"'+data.id+'\" class=\"fb_user\"&gt;
    &lt;img alt=\"'+data.name+'\" height=\"50\" width=\"50\" /&gt;
    &lt;p&gt;
        '+data.first_name+'
        &lt;br/&gt;
        '+data.last_name+'
    &lt;/p&gt;
&lt;/div&gt;';");
</code></pre>

<p>I have gotten so lost in escaping I can't work out where I have gone wrong. The plan is to use eval within the templating function to replace the variables.</p>

<p>Hope someone can help</p>
