Commit 6a676d6e authored by Selina Nicole Brunner's avatar Selina Nicole Brunner

catch empty queries

parent b14b4210
This diff is collapsed.
......@@ -36,6 +36,8 @@ function search(e) {
sendNameQuery(searchValue);
}
// $('searchForm').submit(function(){
//
// console.log(searchValue);
......@@ -46,6 +48,9 @@ function search(e) {
// })
function sendNameQuery(q){
if(q.length==0){
document.getElementById("results").innerHTML = "Bitte gib' einen Suchbegriff ein!"
}else{
var query = "q=poke_txt_en:(" + q +")&rows=100" //rows ist nötig, sonst nur 10 results
console.log(query);
client.search(query,function(err,obj){
......@@ -90,4 +95,5 @@ function sendNameQuery(q){
console.log(obj);
}
});
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment