js获取url参数, 怎么调用它,显示在地图上呢?
var urlParams;
(window.onpopstate = function() {
var match,
pl = /+/g,
search = /([^&=]+)=?([^&]*)/g,
decode = function(s) {
return decodeURIComponent(s.replace(pl, " "));
},
query = window.location.search.substring(1);
urlParams = {};
while (match = search.exec(query))
urlParams[decode(match[1])] = decode(match[2]);
})();
//urlParams的结果
urlParams = {
TextString: "1B024"
}
console.log(urlParams["TextString"]);
业精于勤,荒于嬉;行成于思,毁于随。