views:

47

answers:

1

Hi all, I am using the jquery datepicker and I formated my date as "yy-mm-dd" and from PHP my date format is "Y-m-d". I did an alert and viewed the selected date in the "onSelect" event for the datepicker. Within this event I am using ajax via the jquery "load" function to load content into a div. My problem is very odd behavior! For some dates my action is querying the database and generating an array which I can iterate over and present names.(I'm using kohana PHP framework). On the other hand, other valid dates are not generating any results from the query when, in fact, it should.

This is my Kohana action query

$v->events = ORM::factory('simpleevent')
                ->where('eventdate', '=', $date)
                ->order_by('eventdate', 'desc')
                ->find_all();

This id my javascript for the date picker

$(document).ready(function(){
   $("#datepicker").datepicker({
       dateFormat: 'yy-mm-dd',
       onSelect: function(selecteddate){
           //alert(selecteddate);
           $('#upcommingevents').load('events/findevent/'+selecteddate);
       }
   });
});

Any ideas ?

Ok guys....its the cache. The ajax resuests are being recorded in the cache for IE. I added

$.ajax({
    cache: false
});

before the document is read within the script tag. However this is not clearing the cache memory. Any proper way do do this ?

Thanks.

A: 

You can set HTTP headers in the PHP code that tell the browser not to cache that request:

header("Expires: Mon, 01 Jan 1990 00:00:00 GMT");
header("Cache-Control: no-cache");
header("Pragma: no-cache");
sunetos