Tip: you can modify some code before running
Javascript obtains the parameter value of the link address based on the parameter ID.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.111cn.net/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>Javascript obtains the parameter value of the link address based on the parameter ID.</title><script language="javascript">// Obtain the parameter value of the link address based on the parameter ID function getthe_hrefvar (strVar) {var the_urlvar = "0"; if (strVar) {if (document. location. search. substr (1) {var aParams = document. location. search. substr (1 ). split ('&'); for (I = 0; I<aParams.length; i++){var aParam = aParams[i].split('=');if(aParam[0]==strVar){the_urlvar = aParam[1];break;}}}}return the_urlvar;} //http://111cn.net/index.html?&id=22var url = getthe_hrefvar('id');alert(url);//22</script></head><body></body></html>
Tip: you can modify some code before running