Common set of functions and methods

1, to obtain the parameters url address

function GetQueryString(name) {

  var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");

       var r = window.location.search.substr(1).match(reg);

        if (r != null) {

              return decodeURI(r[2]);

         } else {

               return null;

          }

}

Guess you like

Origin www.cnblogs.com/xqmyhome/p/11956982.html