From ee2c9d85b61fd29da153ce58e4789f5c090dfaec Mon Sep 17 00:00:00 2001 From: IoTcat Date: Sat, 6 Apr 2019 23:13:36 +0800 Subject: [PATCH] add search nothing to offical page --- server/cn/home/www/HomePage/index.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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); } }