标签:.com blog index.php cti nbsp query logs amp ring
var url = "http://www.taobao.com/index.php?key0=0&key1=1&key2=2............."; var obj = parseQueryString(url); function parseQueryString(argu){ var str = argu.split(‘?‘)[1]; var result = {}; var temp = str.split(‘&‘); for(var i=0; i<temp.length; i++) { var temp2 = temp[i].split(‘=‘); result[temp2[0]] = temp2[1]; } return result; }
编写一个参数JavaScript函数parseQueryString,它的用途是把url参数解析为一个对象
标签:.com blog index.php cti nbsp query logs amp ring
原文地址:http://www.cnblogs.com/xiangru0921/p/6514123.html