javascritp添加url参数方法,将参数加入到url中,如果原来url中有则覆盖,下面通过代码实例给大家讲解,具体内容请看下文。
js代码如下所示:
function addToUrl(obj){
var aprotocol = location.protocol;
var ahost = location.host;
var apath = location.pathname;
var asearch = location.search;
var ahash = location.ha
将对象参数加入到url中,如果原来url中有则覆盖
js代码
function addToUrl(obj){
var aprotocol = location.protocol;
var ahost = location.host;
var apath = location.pathname;
var asearch = location.search;
var ahash = location.hash;
var result = '';
console.log(obj);
var join