jquery - Layout mess-up when javascript "keyup" run in google chrome -


i create simple function when keyup using javascript :

<script> //when press enter, submit form, when press shift , enter create new line $("#text_reply1778").keyup(function(e) {     var textval = $(this).val();     if(e.which == 13 && e.shiftkey) {         //here create new line     }     else if (e.which == 13) {        e.preventdefault();         var text_input = $("#text_reply1778").val();         if(text_input != '') { //dont submit if value empty             $('#reply1778').ajaxsubmit( {                 target: '#reply_output1778',                  success: function() {                      //do somthing here                 }              });          }     } }); </script> 

when run using browser google chrome version 26.0.1410.43 layout mess-up not happen when im using firefox.

you can try here (full code) chat1.html , type message inside textarea(chat box) see layout mess-up.

so how avoid ? method can use , try replace keyup keypress result still same.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -