This code generates a comma separated string to provide a list of ids to the query string of another page, but there is an extra comma at the end of the string. How can I re
You can use the String.prototype.slice method with a negative endSlice argument:
endSlice
n = n.slice(0, -1); // last char removed, "abc".slice(0, -1) == "ab"
Or you can use the $.map method to build your comma separated string:
var s = n.map(function(){ return $(this).val(); }).get().join(); alert(s);