0

When i open my web in 1st time IE get data to process, But in next times IE don't get new data to process,It use old data. What happen???

$.get('db/chkBillNo.php',
{
    'branchID' : branchID,
    'toDay' : toDay2
},
function(data)
{
    /****** PROCESS ******/
});

chkBillNo.php

<?php
include 'condb.php';

$query = mysql_query('SELECT COUNT(`billNo`) AS count FROM `bill` WHERE `branchID` = "'.$_GET['branchID'].'" AND `billDate` = "'.$_GET['toDay'].'"  ') or die(mysql_error());

$data = mysql_fetch_object($query);

echo $data->count;
?>

Only IE caused this problem. What causes this problem and then solve it???

PS.My english isn't well. Thank you very much.

ThunderBirdsX3
  • 558
  • 1
  • 9
  • 25
  • The data is being cached - [try something like this](http://stackoverflow.com/questions/404617/disabling-the-browser-cache-in-php-or-using-javascript). – Marty May 02 '14 at 05:32

1 Answers1

0

Try in JS:

function noCache(uri){return uri.concat(/\?/.test(uri)?"&":"?","noCache=",(new Date).getTime(),".",Math.random()*1234567)};

var url = 'db/chkBillNo.php';
url = noCache(url);

$.get(url,
{
    'branchID' : branchID,
    'toDay' : toDay2
},
function(data)
{
    /****** PROCESS ******/
});
Paul Marti
  • 151
  • 5