如果它第一次访问该站点并且没有添加任何查询或者只有一个查询字符串连接到URL'hos',如http://hospitalsite/events/Pages/default.aspx?hos=somevalue,那么我需要应用if条件..the else条件正在fine..How我检查,看看是否有一个查询jquery检查URL是否有查询字符串
$(".hospitalDropDown").change(function(e){
currentURL=$(location).attr('href');
if((currentURL == 'http://hospitalsite/events/Pages/default.aspx' or (....)) {
window.location.href= 'http://hospitalsite/events/Pages/default.aspx'+'?hos='+$(this).val();
} else {
window.location.href = ($(this).val() == "All Hospitals") ? 'http://hospitalsite/events/Pages/default.aspx': currentURL +'&hos='+ $(this).val();
}
});