javascript Programming Glossary: cutoff
Using javascript substring() to create a read more link http://stackoverflow.com/questions/1606336/using-javascript-substring-to-create-a-read-more-link .Value div script type text javascript function var cutoff 200 var text 'div.contentdetail' .text var rest 'div.contentdetail'.. .text var rest 'div.contentdetail' .text .substring cutoff if text.length 200 var period rest.indexOf '.' var space rest.indexOf.. 200 var period rest.indexOf '.' var space rest.indexOf ' ' cutoff Math.max Math.min period space 0 var visibleText 'div.contentdetail'..
|