Automatically wrap English characters and truncate strings using js scripts. This method is applicable to ie6, ie7, and firefox. If you cannot use CSS control to force wrap, you can try
The Code is as follows:
Continuous English characters in irefox. If you want CSS to control forced line breaks, you can use JavaScript scripts to control them for a long time.
Automatically wrap English characters and truncate strings using js scripts. This method is applicable to ie6, ie7, and firefox compatibility solutions.
Automatic line feed for continuous English characters in js
Sssssssssssssssss
Sssssssssssssssssssssssssssssssssssssssssssssssssss
Script
Function toBreakWord (intLen ){
Var obj = document. getElementById ("ff"); // the id of the container where the text content is located
Var strContent = obj. innerHTML;
Var strTemp = "";
While (strContent. length> intLen ){
StrTemp + = strContent. substr (0, intLen) +"
";
StrContent = strContent. substr (intLen, strContent. length );
}
StrTemp + = strContent;
Obj. innerHTML = strTemp;
}
ToBreakWord (50); // maximum number of characters in a row
Script