Before modification:
After modification:
Thanks to the grassroots programmers for rewriting this method to make it more rigorous and efficient. I will learn more about it later! ! !
Note:
1, substr() and substring(start,stop), extract the string between two specified characters between subscripts.
Important: Unlike the slice() and substr() methods, substring() does not accept negative arguments.
See
http://www.jb51.net/w3school/js/jsref_substring.htm 2. location.search.substring(1), location.search is set or returned from question mark ( ?) The starting URL (query part).
See
http://www.jb51.net/w3school/htmldom/prop_loc_search.htm 3. The exec() method is used to retrieve matches of regular expressions in a string. It’s too powerful, I don’t know how to use it yet
Reference
http://www.jb51.net/w3school/js/jsref_exec_regexp.htm 4. Use decodeURIComponent() to encode the encoded URI decoding.
See
http://www.jb51.net/w3school/js/jsref_exec_regexp.htm