Home > Web Front-end > JS Tutorial > Get the parameters behind the request

Get the parameters behind the request

巴扎黑
Release: 2016-11-25 14:35:05
Original
1135 people have browsed it

function getSearchObj() { var url = getSearch(); var searchObj = {}; if (url) { // 去掉?号 url = url.substr(1); if (url.length > 0) { var arr = url.split("&"); for (var i = 0; i  0 && keyVal.indexOf("=") > 0) { var keyValArr = keyVal.split("="); var key = keyValArr[0]; var val = keyValArr[1]; searchObj[key] = val; } } } } return searchObj; } 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template