Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript (jquery) added text comments dont linebreak/ ignore their div container
    text
    copied!<p>Im working on a JavaScript based comment system:</p> <p>This is the Javascript that generates the comment html:</p> <pre><code> $.each(comments.user,function(key,value) { comment_string += '&lt;div class = "r_comment_header"&gt;'; comment_string+= '&lt;a class = "r_comment_user" href = "profile.php?id=' + comments.user_id[key] + '" title = "Profile of ' + value + '"&gt;' + value + ' &lt;/a&gt;'; if(comments.pm_button[key]) comment_string+= '&lt;input type = "button" class = "comment_send_pm" value = "Message" name = "' + comments.user_id[key] + '" title = "Send this user a private message"/&gt;'; comment_string+= '&lt;span class = "r_comment_time"&gt;' + comments.time[key] + '&lt;/span&gt;'; comment_string+= '&lt;/div&gt;'; comment_string+= comments.content[key]; comment_string+= '&lt;div class = "comment_abuse_wrapper"&gt;'; comment_string+= '&lt;input type = "button" class = "comment_report_abuse" name = "' + comments.id[key] + '" value = "Report abuse" title = "Report this comment as inappropriate content"/&gt;'; comment_string+= '&lt;/div&gt;'; }); $('#request_comments').html(comment_string); </code></pre> <p>Now what happens when I add a new comment via a text input field is that the content of the comment ignores the div containers boundaries and does not linebreak:</p> <p><a href="http://i.imgur.com/V85Vc.png" rel="nofollow">http://i.imgur.com/V85Vc.png</a></p> <p>This is the div containers css:</p> <pre><code>#request_comments { width:658px; padding: 10px; margin: 10px 0 0 10px; } </code></pre> <p>any suggestions?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload