JS intercepts the value information of the parameter after the question mark in the url

  • 2020-03-30 02:43:55
  • OfStack

var url=location.search; 
var ename; 
var Request = new Object(); 
var str = url.substr(1); 
strs= str.split("&"); 
for(var i=0;i 
ename = Request["ename"]; 

For example, the url is: http://www.medivh.com? Ename = right

Then the ename obtained is: right.

Related articles: