function treg() { $.post("/tgin.php", { x: document.getElementById("x").value }, function(data){ console.log(data.allowed); }), "json" }