this is my javascript code , I am trying to create a dynamic list in HTML with data I recieve from the server , The data is of type \"json\"
My Javascript snippet
This line in your loop creates multiple list items with the same ID:
listItem.setAttribute('id','gBookListItem');
try removing it - i don't think you need it.