var data = { action: 'sort_product', order: order, orderby: _this.data('orderby'), term: _this.data('term') };
$.ajax({
url: "ajaxurl",
type: "post",
data: data,
success: function(data){
$("#loop").empty().html(data);
var url = new URL(window.location);
url.search = new URLSearchParams(data);
history.pushState("", "", url);
}
});
Но зачем пустое состояние??? Может лучше так?
var data = { action: 'sort_product', order: order, orderby: _this.data('orderby'), term: _this.data('term') };
$.ajax({
url: "ajaxurl",
type: "post",
data: data,
success: function(data){
$("#loop").empty().html(data);
window.location.hash = new URLSearchParams(data);
}
});