Wednesday 26 June 2019

Jquery append is not showing the current output with multidimensional array.

I am trying to show some data on the front end comming form the database like this.$.each(data, function (index, item) { step6_counter1 += 1; $('#check_list_items').append(`
${item.main_point}
${item.sub_points}
`); }) the array form the database looks like this.[{"main_point_id": "1","main_point": "Engagement ","sub_points": {"sub_point_id": "1","main_point_id": "1","sub_point": "engagement sub point 1"}}.{"main_point_id": "1","main_point": "Engagement ","sub_points": {"sub_point_id": "1","main_point_id": "1","sub_point": "engagement sub point 1"}}]​wrong output​the output should look like this

Submitted June 26, 2019 at 07:55AM by binoysarker

No comments:

Post a Comment