passing arguments from one function to another in javascript
<p>I have date value  </p>

<pre><code>  for(i=0;i&lt;data['before'].length;i++) {
        var day = data['before'][i];               
        var dte = new Date(day);
</code></pre>

<p>I am trying to display the dates as a link in a div dynamically from java script. On clicking the link I am passing dte as object to <code>date_click</code> function. </p>

<pre><code>$('#before_dates').append('&lt;tr&gt;&lt;td&gt;&lt;a onclick="date_click('+dte+');" href="javascript:void(0)"&gt;'+dte.toDateString()+'&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;');
</code></pre>

<p>On clicking the link the </p>

<pre><code>function date_click(date){
    alert("Hi..."+dte);
}
</code></pre>

<p>I am getting following error:</p>

<p><strong>Error: SyntaxError: missing ) after argument list<br>
Source Code: date_click(Fri Aug 31 2012 00:00:00 GMT+0100 (IST));</strong></p>

<p>I know its small error, but I could not figure a way to do that. Any help would be great.</p>

<p>Thank You</p>
