???getquerystring?????,????encodeURIComponent()?decodeURIComponent()???JavaScript????????????????
??,???url?,????encodeURIComponent()????????:
var param = '???'; var encodedParam = encodeURIComponent(param); var url = 'http://example.com?param=' + encodedParam;
???url?????,????decodeURIComponent()????????:
var queryString = 'param=参数值'; var params = {}; queryString.split('&').forEach(function (pair) { var keyValue = https://www.yisu.com/ask/pair.split('='); params[keyValue[0]] = decodeURIComponent(keyValue[1]); });
??????????????getquerystring?????,?????url?????????