Home >Web Front-end >JS Tutorial >JavaScript extracts parameters in the search string of the URL (custom function implementation)_javascript skills
Today I found a useful function urlArgs (extracts the parameters in the search string of the URL) in the Rhino book. We often see that some page link addresses are followed by parameters, such as http://www.xxx.com/?username=yyy&password=zzz. Many times we need to obtain the values of these parameters (yyy and zzz ), then you can use the urlArgs function to obtain it through the properties of the function's return value (the return value is an object).
urlArgs function code: