I am getting data from JSON and then create rows of it:        $.each(data.GetwebMethodResult, function (index, item) {        $(#TableABC).append(FunABC(item.aID, item.b, item.c, item.d, item.e, item.f));        });function FunABC(a, b, c, d, e, f) {    var row =        <tr class='Row' onclick=\AnotherUnrelatedFunction(' + a + ' , ' + b + ', ' + c + ', ' + d + ', ' + e + ', ' + f + ')\> +           <div class='mr'> +               <td class='mc mci'> +                   <div class='mcit'> + a + </div> +               </td> +           </div> +        </tr>;    return row;}Is there any better way of doing it?
Creating rows from JSON data
javascript;json
I would think so;encoding listeners through HTML onclick is old skoolvariable names a,b,c,d,e,f earn an award for 2014 worst variable namesinstead of sending just the item, you are sending every property you need.you are setting content and listeners in one place ( mixing view and controller )You have a div between tr and td, which should not even workI would counter-propose something like$.each(data.GetwebMethodResult, function (index, item){  $(#TableABC).append( $(generateRow(a)).click( function(){     anotherUnrelatedFunction( item );  }));});function generateRow(a) {  return '<tr class=Row mr>' +            '<td class=mc mci>' +              '<div class=mcit>' +               a +              '</div>' +           '</td>' +          '</tr>';}This basically keeps the HTML stringing separate from the onClick handler assignment. Through closure it passes the entire item object to anotherUnrelatedFunction which means the signature becomes more concise (you would have to adjust anotherUnrelatedFunction obviously).