In the project, you need to obtain the get parameter through JS, find the following plug-in on the Internet:
For example, your url is:
Http://www.xxx.com/index.php? Test = 1 & KK = 2
If you want to obtain test, you can introduce the plug-in,
Obtain it using the following method:
VaR test = $. query. Get ('test ');
If multiple parameters have the same name, you can do this:
VaR arr = $. query. Get ('testy ');
Output: [value 1, value 2, value 3...]
To obtain one of multiple identical names, you can:
VaR arrayelement = $. query. Get ('testy [1] ');
This plug-in can not only obtain parameters, but also set parameters.
Set a parameter:
VaR newurl = $. query. Set ("section", 5). tostring ();
Output :"? Section = 5"
Set two parameters:
VaR newurl = $. query. Set ("section", 5). Set ("action", "do"). tostring ();
Output :"? Action = Do & Section = 5"
Delete a parameter:
VaR oldqueryagain = $. query. Remove ("type ");
Clear all parameters:
VaR emptyquery = $. query. Empty ();
Copy all parameters:
VaR stillthesame = $. query. Copy ();
Plug-in address:
Http://plugins.jquery.com/project/query-object