jquery获取url参数
(function($){
var deparam=function(querystring){
var params={};
var queryarray=(querystring||"").split("&");
$.each(queryarray,function(index,item){
var keyValuePairs=item.split("=");
var key=keyValuePairs[0];
if(key){
var value=decodeURIComponent(keyValuePairs[1]);
params[key]=value||"";
}
});
return params
};
$.extend($,{deparam:deparam})
})(window.jQuery);
$(function(){
var search = location.search.slice(1);
var param = $.deparam(search);
console.log(param);
var appid = param.appid || '';
var merchant = param.merchant || '';
var hotelid = param.hotelid || '';
var checkin = param.checkin || '';
var checkout = param.checkout || '';
var wticket = param.wticket || '';
});
jquery获取url参数,jquery获取url参数