Trying to call a function in javascript
<p>This is my code all I need to do is call a function which will write the contents to a dynamic div</p>

<pre>
&lt;script language='javascript' type='text/javascript'&gt;
function getComments(id)
{
  alert(id);
}
var resultSet="";
function CreateDiv()
{

resultSet+="&lt;br/&gt;&lt;div id='"+rows.data[i].id+"'>&lt;/div&gt;&lt;script language='javascript' type='text/javascript'> getComments("+rows.data[i].id+"); &lt;\/script>";
}
window.onload=CreateDiv;
&lt;/script&gt;
</pre>

<p>The function getComments is not being called at all</p>

<p>What's that I am missing here</p>
