if(url==undefined){ url = location.href; } window.location.href = url; }) //删除已选 $(".chooseitem").find('i').click(function(){ var url = $(this).parent().attr('data-url'); window.location.href = url; }) //清空筛选条件 $('.clearc').click(function(){ var url = SITEURL+'hotels/all/'; window.location.href = url; }) //隐藏没有属性下级分类 $(".type").each(function(i,obj){ var len = $(obj).find('dd p a').length; if(len<1){ $(obj).hide(); } }) //价格和星级选择 $(".sel-day").change(function(){ window.location.href= $(this).val(); }); function changeURLPar(destiny, par, par_value) { var pattern = par+'=([^&]*)'; var replaceText = par+'='+par_value; if (destiny.match(pattern)) { var tmp = '/'+par+'=[^&]*/'; tmp = destiny.replace(eval(tmp), replaceText); return (tmp); } else { if (destiny.match('[\?]')) { return destiny+'&'+ replaceText; } else { return destiny+'?'+replaceText; } } return destiny+'\n'+par+'\n'+par_value; } })