Posted By

audiopleb on 10/18/10


Tagged

ExpressionEngine


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


Live Comment Preview for Expression Engine


 / Published in: jQuery
 

  1. $(function() {
  2. $('#comment').one('focus',function() {
  3. });
  4. var $comment = '';
  5. $('#comment').keyup(function() {
  6. $comment = $(this).val();
  7. $comment = $comment.replace(/\n/g, "<br />").replace(/\n\n+/g, '<br ><br />').replace(/(<\/?)script/g,"$1noscript");
  8. $('p.live-preview').html($comment);
  9. });
  10. });
  11.  
  12.  
  13.  
  14. <div class="comment-preview">
  15. <h3>My Comment Preview</h3>
  16. <p class="live-preview">placeholder text</p>
  17. </div>

Report this snippet  

You need to login to post a comment.