DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   Show overflow of text by "..." in javascript (http://www.daniweb.com/forums/thread113341.html)

serkansendur Mar 11th, 2008 12:29 pm
Show overflow of text by "..." in javascript
 
function SplitText(text,count)
{
if(text.length > count)
{
var _temps = text.substring(0,count);
return _temps + "...";
}
else
{
return text;
}
}

Example :

var s = SplitText("serkansendur",5);

s will be "serka".

DangerDev Mar 12th, 2008 9:20 am
Re: Show overflow of text by "..." in javascript
 
Hi,
what's your question ? if you want to put code snippets for others, to help, please go here


All times are GMT -4. The time now is 11:18 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC