I need to turn xmlhttp.responseText into a column of links that will be displayed in a popup div.

I've defined xmlhttp.responseText as var named txt with:

var txt=xmlhttp.responseText;

That produces a var with comma delimited values.

I'd like to proceed by passing txt through a For Loop that will create the links, but I can't find a method that will count commas.

How do I return the number of commas in javascript?