diff --git a/server/cn/home/www/HomePage/index.html b/server/cn/home/www/HomePage/index.html index fc904f1..774d136 100644 --- a/server/cn/home/www/HomePage/index.html +++ b/server/cn/home/www/HomePage/index.html @@ -28,29 +28,29 @@ function do_baidu_search() { var search_txt = document.getElementById("search-bar-input").value; if (search_txt == "") { - alert("search text is empty ! "); - return false; + window.open("https://www.baidu.com"); + return; } - var search_url = "https://www.baidu.com/s?wd=" + search_txt; + var search_url = "https://www.baidu.com/s?wd=" + encodeURI(search_txt); window.open(search_url); } function do_google_search() { var search_txt = document.getElementById("search-bar-input").value; if (search_txt == "") { - alert("search text is empty ! "); - return false; + window.open("https://www.google.com"); + return; } - var search_url = "https://www.google.com/search?newwindow=1&hl=zh-CN&q=" + search_txt; + var search_url = "https://www.google.com/search?newwindow=1&hl=zh-CN&q=" + encodeURI(search_txt); window.open(search_url); } function on_enter_key(){ if (event.keyCode==13){ var search_txt = document.getElementById("search-bar-input").value; if (search_txt == "") { - alert("search text is empty ! "); - return false; + window.open("https://www.google.com"); + return; } - var search_url = "https://www.google.com/search?newwindow=1&hl=zh-CN&q=" + search_txt; + var search_url = "https://www.google.com/search?newwindow=1&hl=zh-CN&q=" + encodeURI(search_txt); window.open(search_url); } }