lyndalijun
Joined: 24 May 2007 Posts: 1
|
Posted: Thu May 24, 2007 8:41 pm Post subject: how to get the first sentence from an article? |
|
|
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 |
|