搜索数据刷新页面(超级蠢的需求)
作者:
泉落云生 | 来源:发表于
2018-04-18 20:55 被阅读1次var _href = "{{ config('app.source_url') }}merchants/shareEvent/list";
function searchName(that){
var thisurl = window.location.href;
var inval = $(that).val();
if(thisurl.match(/(type=0)/g)){
window.location.href=_href+'?type=0&product_name='+inval
}else if(thisurl.match(/(type=1)/g)){
window.location.href=_href+'?type=1&product_name='+inval
}else{
window.location.href=_href+'?product_name='+inval
}
//下面不合理,会跳转页面,因为有三种状态,都会返回''
$.ajax({
type:'get',
url:_href,
dataType:"html",
contentType:'application/json; charset=utf-8',
data:{
product_name:$('#searchInput').val(),
},
success:function(res){
$("body").html(res);
}
})
}
本文标题:搜索数据刷新页面(超级蠢的需求)
本文链接:https://www.haomeiwen.com/subject/rlvbkftx.html
网友评论