Q: Error in firefox console while trying to reflect a querys result(cleint side) in a div (client side) using ajax object The error's screenshot shared below 

I have written a javascript function which is triggered when I select a certain option from a dropdown menu. A query is executed on the server side based on this selection and the response is to be displayed inside a div on the client side , but I am getting a strange error in my console in firefox. Would really appreciate if someone can help me out on what I am comitting wrong.
here is the javascript that i have written
function changeLocation()
        {
            var x= document.getElementById("state");
            var val = x.options[x.selectedIndex].value;// value selected by user in state is assigned to variable var

            var xhttp;
            if (window.XMLHttpRequest)
            { // Mozilla, Safari, ...  
                 xhttp = new XMLHttpRequest();  
            } 
            else if (window.ActiveXObject)
            { // IE 8 and older  
                xhttp = new ActiveXObject("Microsoft.XMLHTTP");  
            }  
            xhttp.open("GET","localhost/location.php?t=" + val,true);//variable being sent is t
            xhttp.send(null);

            xhttp.onreadystatechange = function()//error checking required
            {
                 if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
                {
                    //document.getElementById("location").value = xmlhttp.responseText;
                    var ajaxdisp = document.getElementById("location")
                    ajaxdisp.innerHTML = xmlhttp.responseText;//need to look through full manual for it
                }
                else
                {
                    alert("needs Debugging");
                }
             }
        } 

here 'state' is the id of the dropdown and 'location' is the id of the div where i need to reflect the change
the php code is
<?php
            include "logconnect.php";
            $t = $_REQUEST["t"];
            $result = $conn->query("SELECT DISTINCT location FROM office where state = '".$t."'");
            $disp = "<select>";
            while($row = $result->fetch_assoc())
            {
                $disp .= "<option>";
                $disp .= $row['location'];
                $disp .= "</option>";
            }
            $disp .= "</select>";
            echo $disp;?>

The question is different from <getting an error "ns_error_unknown_protocol> as here the error is related to some function , that might be due to firefox's internal settings, not recognizing ajax , these are my best guesses but I need help to identify the correct one.
