Improve domain whitespace handling in inputs

This commit is contained in:
Mcat12
2017-11-22 13:25:23 -05:00
parent 40e6c5faf1
commit 3ec55dbf0a
2 changed files with 6 additions and 5 deletions

View File

@@ -57,9 +57,10 @@ function httpGet(ta,quiet,theUrl)
function eventsource() {
var ta = $("#output");
var domain = $("#domain");
var domain = $("#domain").val().trim();
var q = $("#quiet");
if(domain.val().length === 0)
if(domain.length === 0)
{
return;
}
@@ -73,12 +74,12 @@ function eventsource() {
// IE does not support EventSource - load whole content at once
if (typeof EventSource !== "function") {
httpGet(ta,quiet,"/admin/scripts/pi-hole/php/queryads.php?domain="+domain.val().toLowerCase()+exact+"&IE");
httpGet(ta,quiet,"/admin/scripts/pi-hole/php/queryads.php?domain="+domain.toLowerCase()+exact+"&IE");
return;
}
var host = window.location.host;
var source = new EventSource("/admin/scripts/pi-hole/php/queryads.php?domain="+domain.val().toLowerCase()+"&"+exact);
var source = new EventSource("/admin/scripts/pi-hole/php/queryads.php?domain="+domain.toLowerCase()+"&"+exact);
// Reset and show field
ta.empty();