why an additional div is displayed when m redering view in backbone.js
Backbone.View.extend({ template :_.template( '<li id="user-<%=user.username%>" class="pp-entry group">'+ '<img src="i/pp-pic-1.png" class="pp-pic" alt="" />'+ '<span class="whisper-mode-on hide" title="Whisper mode on"></span>'+ '<h6 class="pp-name"><%=user.firstname%> <%if(user.lastname!="null"){%><%=user.lastname%><%}%></h6>'+ '<p id="chat-<%=user.username%>"class="pp-msg"></p>'+ '</li>'), initialize: function() { _.bindAll(this, 'render', 'close'); this.model.bind('change', this.render); this.model.view = this; }, // Re-render the contents of the User item. render: function() { $(this.el).html(this.template(this.model.toJSON())); $("#participant-window").prepend(this.el); } });
when he gets this rendering as follows:
<ul id="participant-window" class="scroll-pane" style="overflow: hidden; padding: 0px; width: 357px;"> <div> <li id="user-ashutosh" class="pp-entry group" style="cursor: default;"> <img class="pp-pic" alt="" src="i/pp-pic-1.png"> <span class="whisper-mode-on hide" title="Whisper mode on"></span> <h6 class="pp-name">Ashutosh </h6> <p id="chat-ashutosh" class="pp-msg"></p> </li> </div> </ul>
why li is inserted in a div, how should i stop this?
source share