when I make a change in my select box, how can I tell if the function is firing?
<script>
document.getElementById('to_device_id').addEventListener('change',postPorts);
function postPorts(e){
e.preventDefault();
var xhr = new XMLHttpRequest();
xhr.open('POST', '../data_connections/port_options.php');
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.onload = function(){
document.getElementById('Ports').innerHTML = this.responseText;
}
xhr.send("to_device_id="+document.getElementById('to_device_id').value);
}
</script>