javascript中的Split使用方法与技巧
使用方法:
myArray=string.split("|");
example:
< scriptlanguage = " JavaScript " >  
<!--  
functionRequest(strName) 
{ 
varstrHref
="www.nextway.cn/index.htm?a=1&b=1&c=Split实例"; 
varintPos
=strHref.indexOf("?"); 
varstrRight
=strHref.substr(intPos+1); 
vararrTmp
=strRight.split("&"); 
for(vari=0;i<arrTmp.length;i++) 
{ 
vararrTemp
=arrTmp[i].split("="); 
if(arrTemp[0].toUpperCase()==strName.toUpperCase())returnarrTemp[1]; 
}
 
return""; 
}
 
alert(Request(
" a " )); 
alert(Request(
" b " )); 
alert(Request(
" c " )); 
// --> 
</ script >