send ajax request on change event
HTML
<input type="text" id="auto" value="Europe/Berlin" />
<div><div></div></div>
CSS
input, div{
margin:5px;
}
div {
border: 8px dashed #222;
border-radius: 12px;
background-color: #e5e517;
min-height: 40px;
}
div > div {
font: 14px monospase;
font-weight: bold;
color: #222;
background-color: #fff;
border: 1px solid #fff;
border-radius: 3px;
padding: 3px;
margin:0;
}
JavaScript
function runajax(){
$.ajax({
cache : false,
type: "POST",
data: { json : '{ "timezone":"'+$(this).val()+'"}' },
url: "/echo/json/",
success : function(respse){
// here response from server in object "response"
$('div>div').html(JSON.stringify(response));
}
ghghfghgfh
});
}
$(document).ready(function(){
$("#auto").change(runajax);
});