append to url and refresh page

后端 未结 11 2236
终归单人心
终归单人心 2020-12-07 14:07

I am looking to write a piece of javascript that will append a parameter to the current url and then refresh the page - how can I do this?

11条回答
  •  青春惊慌失措
    2020-12-07 15:08

    Try this

    var url = ApiUrl(`/customers`);
      if(data){
       url += '?search='+data; 
      }
      else
      { 
          url +=  `?page=${page}&per_page=${perpage}`;
      }
      console.log(url);
    

提交回复
热议问题