hi ,
Is there any way to get only the Pure Text from the html .
coz when i enter some thing in FCK editor , like ,
the Quick Browb Fox jumps ......
the Source which i will get will be
and i want to Print only 2 wards then dots(...)
but the <p> is being counted as a word.
and it is difficult to remove HTML and get Pure Text , coz what ever u do , u r left with spaces and "&" etc.......
any help will be Appreciated .
Regards.
Is there any way to get only the Pure Text from the html .
coz when i enter some thing in FCK editor , like ,
the Quick Browb Fox jumps ......
the Source which i will get will be
<p>the Quick Browb Fox jumps over the lazy dog</p>
and i want to Print only 2 wards then dots(...)
but the <p> is being counted as a word.
and it is difficult to remove HTML and get Pure Text , coz what ever u do , u r left with spaces and "&" etc.......
any help will be Appreciated .
Regards.

Re: Only Want Text No HTML.....
function GetInnerText() { // This functions shows that you can interact directly with the editor area // DOM. In this way you have the freedom to do anything you want with it. // Get the editor instance that we want to interact with. var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ; // Get the Editor Area DOM (Document object). var oDOM = oEditor.EditorDocument ; var iText ; // The are two diffent ways to get the text (without HTML markups). // It is browser specific. if ( document.all ) // If Internet Explorer. { iText = oDOM.body.innerText ; } else // If Gecko. { var r = oDOM.createRange() ; r.selectNodeContents( oDOM.body ) ; iText = r.toString() ; } alert( 'Text content:\n' + iText ) ; }Then you can get the text by calling the function getInnerText():
Re: Only Want Text No HTML.....
thanks a Lot.
Regards ,