var exact = ""; function eventsource() { var ta = $("#output"); var domain = $("#domain"); var q = $("#quiet"); if(domain.val().length === 0) { return; } // IE does not support EventSource - exit early if (typeof EventSource !== "function") { ta.show(); ta.html("Querying ad lists is not supported with this browser!"); return; } var quiet = false; if(q.val() === "yes") { quiet = true; exact = "exact"; } var host = window.location.host; var source = new EventSource("/admin/scripts/pi-hole/php/queryads.php?domain="+domain.val().toLowerCase()+"&"+exact); // Reset and show field ta.empty(); ta.show(); source.addEventListener("message", function(e) { if(!quiet) { ta.append(e.data); } else { var lines = e.data.split("\n"); for(var i = 0;i