Truncate dynamic text under ASP/Javascript
I need an extension which can truncate text from a recordset field to a runtime-definable number of characters or words. "Crop Sentence" by Jason Parker and "Truncate It" by Ranjan Datta both do just what I need but they only support ASP/VBScript, I need to use JavaScript.
The ability to add trailing characters would be a big advantage but I can work around that if necessary.
Can anyone help?
TIA,
Niall
Comments
Truncate dynamic text under ASP/Javascript
hope this will help you
;)
<%
var myString = (rsName.Fields.Item("MemoColumn").Value)
document.write(myString.substring(0,100))
%>
RE: Truncate dynamic text under ASP/Javascript
hey, that looks like just the thing, thanks! Working on something else at the moment but still need that code, will give it a shot when I get back to that bit and post results here.
Thanks Marino!
You must me logged in to write a comment.