标签:style blog color io ar div cti log amp
获取url地址参数值方法:
1 function GetQueryString(name) 2 { 3 var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i"); 4 var r = window.location.search.substr(1).match(reg); 5 if (r!=null) return unescape(r[2]); 6 return null; 7 }
例子:
1 var bg = GetQueryString("bg-color"); 2 if (bg) { 3 alert(bg) 4 }
标签:style blog color io ar div cti log amp
原文地址:http://www.cnblogs.com/hwgq2005/p/3931717.html