I have a fancybox, and for some reason it gets cached.
My current problem is layout this way. I have main index page, where I have a link. Clicking on the link open the jquery fancybox. The fancybox is actually opening the page called data.php. That page has a drop down that is populated through the database column. So when I change something there, it updates the databased(I confirmed that) it also changes the status on the index page (confirmed too) but when I click the link and open the fancy box the drop down value is still old value. If I logout and logback in then it works fine or if I go to data.php page directly I can see the correct value. Which tells me that something is wro开发者_JAVA百科ng with the fancybox. I tried fancybox property cache: flase but didnt help. Any help will be greatly appreciated. Thanks$(document).ready(function() {
$.ajaxSetup({ cache: false });
});
Your browser is probably caching the data. You can have your data.php script tell the browser to not cache the data using HTTP headers.
An example:
<?php
header('Expires: Sun, 19 Nov 1978 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Pragma: no-cache');
?>
精彩评论