function changeme(name) { var xmlHttp = new XMLHttpRequest(); var params = "category="+name; xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { if (xmlHttp.status == 200) { document.getElementById('products').style.display = "block"; document.getElementById('products').innerHTML = xmlHttp.responseText; } } } xmlHttp.open("POST", "includes/form-order-ajax.php", true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", params.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.send(params); }