Get the App
SLTechnology News&Howtos  ›  Development  › 

How to get URL transfer parameters by JavaScript

Shulou Source: shulou.com Published: 2022-06-01 04:34:48 09月22日 Update

Editor to share with you JavaScript how to obtain URL transmission parameters, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Get URL transmission parameters (Chinese is supported)

Function getQueryString (name) {var reg = new RegExp ('(^ | &)'+ name +'= ([^ &] *) (& | $)','i'); var r = _ window.location.search.substr (1) .match (reg); if (r! = null) {return decodeURI (r [2]);} return null } / / call method GetQueryString ("parameter name") above is all the content of the article "how to get URL transfer parameters by JavaScript". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Parameters transmission articles content not much most methods more knowledge industry information information channels channels Chinese reference learning help support Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Linux NVidia macOS Shulou Information