Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


how to get the first sentence from an article?



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
lyndalijun



Joined: 24 May 2007
Posts: 1

PostPosted: Thu May 24, 2007 8:41 pm    Post subject: how to get the first sentence from an article? Reply with quote

I want to get first sentence or paragraph from a description text body, however, the description text body I got from xml is very big, it is a full article. I don't know much xml and cannot find a way just get a partial description after search the whole internet. I am trying to use javascript function split, however, the passed value is so big, javascript function failed. here is my javascript code:
<script>
function splitDescription(value){
var temp = new Array();
temp =value.split('.');

return temp[0];

}
var description ='<valueof bean="TempVar.description" valueishtml/>';
splitDescription(description);
</script>

<valueof bean="TempVar.description" valueishtml/> is value of text body from xml, which is whole article. Is there anyway I can split this big text body?

Thanks
Lynda
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap