A recent page, you need to use JavaScript to get the URL parameters, can be found on the Internet, is more, the error is really much ah, really dizzy, wasted a lot of my time so, I will sum up, a good can be, the first statement, with regular, is simple, but the compatibility of multiple browsers, And speed is not guaranteed, so I use a browser-compatible
Copy Code code as follows:
<script language = javascript>
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=request (' url ');
var theimg=request (' img ');
Document.writeln ("<a href=" "+ theURL +" ' target=_blank> ");
</script>
The main thing is to use the
Copy Code code as follows:
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;
}
}
This function, later on the convenience, not everywhere to find the