build html table with jQuery xml response

I'm attempting to iterate through a response from a jQuery Ajax request (returned as XML). With that response, I'm building an HTML table with 3 columns (capable of an unlimited number of rows). Once the 4th XML node/ "company" is found, it should start a new row in the table. Any help with the JS to determine when the new row should be added is most appreciated. Thanks! JS example: /* jQuery Ajax Call here */ success: function(xml){ var trow = $(""); $(xml).find("Company").each(function(index){ var cellData = "
"+ ""+ "
"+ $(this).attr("Description") + "
"; $(cellData).appendTo(trow); }); trow.appendTo('#tbl'); } }); }); Example XML response from web service:

以上就是build html table with jQuery xml response的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准