function getQuery(key) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"),
r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2])
return null
}
this code is an encapsulated function to get the parameters on URL. It uses regular matching, but my regular is relatively weak. Trouble the big gods in the community to help me interpret
.(^ | &): what does it mean
= ([^ &] *) (& | $) what does it mean