Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 25th, 2012  |  syntax: None  |  size: 0.36 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Limit words that also take numbers in consideration
  2. function trim_words(text, limit){
  3. var words = text.split(/b[s,.-:;]*/,limit);
  4. theNewString=words.join(" ");
  5. return theNewString;
  6. }
  7. jQuery('#title').keyup(function(){
  8.     jQuery(this).val(trim_words(jQuery(this).val(),3));
  9. });
  10.        
  11. text.split(/b[s,.-:;d]*/,limit);
  12.        
  13. text.split(/b[s,.-:;]*/,limit);
  14.        
  15. /b[s,.-:;]*/