Javascript 获取链接(url)参数的方法_javascript技巧

WBOY
Release: 2016-05-16 18:55:55
Original
1084 people have browsed it

方法1:将链接当作字符串 ,按照链接的格式分解,然后获取对应的参数值。
方法2:用正则直接匹配。
关键字:parameter 参数:location.href,url ,链接,javascript
方法1:
分解链接方式:

复制代码代码如下:



方法2:
用正则匹配方式:
复制代码代码如下:


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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!