extract string from inside an attribute

Kicyhycle

New Member
I need to write a function like this:\[code\]var width=getWidth( $(this).attr("ows_MetaInfo"));\[/code\]where $this is pointing to the xml row .in the \[code\]getWidth(meta){}\[/code\] funtion i need to find the text vti_lastheight and do some split and stuff and grab the numeric height value which is 250. How do i do this in javascript or jquery??\[code\]<z:row ows_Title='We are together!' ows_ImageSize='620' ows_MetaInfo='16;#vti_parserversion:SR|14.0.0.6120
vti_lastheight:IW|250
vti_lastwidth:IW|620
vti_description:SW|Lorem ipsum dolor sit volutpat.' />\[/code\]Update: I found that someone had written a function to grab the description value from vti_description. Can someone explain to me how this function is able to extract the description portio of text "lorem ipsum' part and how i can make use of it to extract the lastheight value? Please?\[code\]function getDescription(metaInfo) { var description=""; if(metaInfo!=null) { metaParts=metaInfo.split("\n"); if(metaParts!=null && metaParts.length>0) { var i=0; do { if(metaParts.indexOf("vti_description")>-1) { var descParts=metaParts.split("|"); if(descParts!=null && descParts.length>1) { description=descParts[1]; } } i++; } while (i<metaParts.length && description=="" ); } } return description; }\[/code\]
 
Back
Top