CodeIgniter Forums

Full Version: [SOLVED] jquery $.get - IE7 gets wrong value
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum


it is strange problem. Here is simple jquery code:

        var base_url = '<? echo base_url() ?>';
        $.get(base_url+"admin_/reklama/head_ad_id/", function(h_id){
            $('#up_' + h_id).hide();
        $.get(base_url+"admin_/reklama/underpart_ad_id/", function(u_id){
            $('#down_' + u_id).hide();

and there is the function which is called by jquery:

function head_ad_id()
        $query = $this->db->select('rek_id')->where('queue',1)->get('reklama');
        $row = $query->row();
        $id = $row->rek_id;
        echo $id;

How can IE get diferent id from this function? Firefox, opera, chrome gets the correct value. Sometimes IE gets correct value, sometimes not.

After I restart IE and go to the same page, it gets correct value. So maybe it somehow remembers that value from earlier, because I do this - load the page on IE and firefox. Then I click a button in firefox so it make changes in database. Then I refresh the page in IE to see if something changed - some content I can see is changed so the whole page isn't in them memory, but that value from $.get insn't and it hides the wrong button.

El Forum

I think that IE is caching the call. Use post or append some random string to url:



El Forum

Thanks, I added random string and that works Smile