I am having a problem with ajax not posting data as expected, i am using the Codeigniter calendar library and have added classes to each Table Row and Table Data tag so that when you click on any table cell the below code will fire. not sure what is going wrong
here is the code:
<script type="text/javascript">
$('.calendar .day').click(function(){
get_day_num();
});
function get_day_num()
{
//this alert shows 'undefined' ??
alert($(this).find('.day').html());
//values being passed to sendValue are probably 'undefined' - why?
sendValue($(this).find('.day_num').html(),$(this).find('.content').html())
}
function sendValue(day_num,day_data)
{
$.ajax({
url: window.location,
type: 'POST',
data: {
day: day_num,
data: day_data
},
complete: function(msg)
{
location:reload();
}
});
}
</script>