diff --git a/htdocs/mapscript.js b/htdocs/mapscript.js index 99f0854..46cd08a 100644 --- a/htdocs/mapscript.js +++ b/htdocs/mapscript.js @@ -235,6 +235,7 @@ function htmlEntities(str) { var regex; function search(e) { var query = htmlEntities(document.getElementById("search_query").value); + document.getElementById('search_results').innerHTML = ""; if (query.length > 0 || e.key == "Enter") { results = document.createElement("ul"); for (var i = 0; i < layers._layers.length; i++) { @@ -257,10 +258,9 @@ function search(e) { } } } - document.getElementById('search_results').innerHTML = "Search results for " + query; document.getElementById('search_results').appendChild(results); - return false; } + return false; } L.MyControl = L.Control.extend({