Recently, the website was revised and found that all the website advertisements are direct URLs. If you switch to the website, it will be better for the full-time website.
An HTML page is required to pass parameters. Therefore, a JS is used to obtain URL parameters. Code, Just funciton
Reference http://img.jb51.net/url.htm? Url = http://www.baidu.com
Copy codeThe Code is as follows: <script language = "JavaScript" type = "text/JavaScript">
// JS obtains the function of the URL parameter
Function request (paras ){
VaR url = location. href;
VaR parastring = URL. substring (URL. indexof ("? ") + 1, URL. Length). Split ("&");
VaR paraobj = {}
For (I = 0; j = parastring [I]; I ++ ){
Paraobj [J. substring (0, J. indexof ("="). tolowercase ()] = J. substring (J. indexof
("=") + 1, J. Length );
}
VaR returnvalue = paraobj [paras. tolowercase ()];
If (typeof (returnvalue) = "undefined "){
Return "";
} Else {
Return returnvalue;
}
}
VaR theurl
Theurl = request ("url ");
If (theurl! = ''){
Location = theurl
}
</SCRIPT>