Get a value from an NVP String
May 17th, 2005 by Intermanaut
To use this, call GetNVP(string NVPString, string NVPid) with the input NVP string and the name of the value you want to retrieve.
<script type=”text/javascript”>
<!–
function GetNVP(NVPString,NVPid)
{
var NVPFound=false;
var NVPArray=new Array();
var NVPList=NVPString.split(‘&’);
for (x=0; x<NVPList.length; x++)
{
NVPData=NVPList[x].split(‘=’);
NVPArray[NVPData[0>=NVPData[1];
}
for (var LocalID in NVPArray)
if(NVPid==LocalID)
NVPFound=true;
if (NVPFound)
return (NVPArray[NVPid]);
else
return (‘Name not found’);
}
–>
</script>