日期:2014-05-17 浏览次数:20382 次
function hooyesQueryString(queryStringName){ var returnValue=""; var URLString=new String(document.location); URLString=URLString.toLowerCase();//转换为小写 var serachLocation=-1; var queryStringLength=queryStringName.length; do { serachLocation=URLString.indexOf(queryStringName+"/="); if (serachLocation!=-1) { if ((URLString.charAt(serachLocation-1)=='?') || (URLString.charAt(serachLocation-1)=='&')) { URLString=URLString.substr(serachLocation); break; } URLString=URLString.substr(serachLocation+queryStringLength+1); } } while (serachLocation!=-1) if (serachLocation!=-1) { var seperatorLocation=URLString.indexOf("&"); if (seperatorLocation==-1) { returnValue=URLString.substr(queryStringLength+1); } else { returnValue=URLString.substring(queryStringLength+1,seperatorLocation); } } return returnValue; }