undefine variable in ajax
i am posting hCenter div's html in result.php page. i tried it val() also but error is head not defined.
function headerT() {
valhead = "";
valhead = $("#hCenter").html();
alert(valhead);
$.ajax( {
url: 'result.php',
type: 'post',
data: "head="+valhead
})
.done ( function (msg) {
});
}
result.php
echo $_POST['head'];
please help me