Embedding javascript object in dynamically created html
<p>I have a js function that recieves an array of items. The function itself creates html content dynamicly using a call to jquery html function. The problem is that I don't remember how to embed correctly the array inside the appended html. For example,</p>

<pre><code>var ErrorsNotifier = {
   init: function(items) {
        var template = '&lt;div id="message"&gt;'; 
        template += '&lt;div id="id"&gt;some message.&lt;br /&gt;&lt;br /&gt;'; 
        template += '&lt;div class="errorsList"&gt;error desc&lt;/div&gt;&lt;/div&gt;'; 
        template += '&lt;a href="#" class="goback" onclick="ErrorsNotifier.Back("+items+");"&gt;&lt;/a&gt;'; 
        template += '&lt;a href="#" class="proceed" onclick="ErrorsNotifier.Next();"&gt;&lt;/a&gt;'; 
        template += '&lt;input type="image" src="someimage" alt="" class="" onclick="window.open("someurl");"/&gt;&lt;/div&gt;'; 
        $("#content").html(template);
   }
}
</code></pre>

<p>After the html will be rendered to the body, clicking on the anchor tag return the following error - <code>Uncaught SyntaxError: Unexpected identifier</code> </p>

<p>inspecting the anchor tag in the browser will show the following</p>

<pre><code>a href="#" class="goback" onclick="ErrorsNotifier.Back([object Object]);"
</code></pre>
