Welcome Guest, Not a member yet? Register   Sign In
Session problem when using jQuery.load() function
#1

[eluser]FordEscort[/eluser]
Hi all.

I'm using IE 8.0.6001.18702 and Firefox 3.5.3.
I have a problem with CI's session when dealing with jQuery.load method.
In Firefox everything is OK but in IE it seems that the session is not recognized.
Here's a simplified sample code of my application :

controllers/test_session.php :

Code:
<?php

    class Test_session extends Controller
    {
        function __construct()
        {
            parent::Controller();
        }

        function index()
        {
            $this->load->view('test_session');
        }

        /**
         * La fonction qui changera la valeur en session et chargera le résultat dans le div
         */
        function testLoad()
        {
            $Val = $this->session->userdata('testVal');
            if (!empty($Val))
            {
                $Val++;
            } else
            {
                $Val = 1;
            }
            echo $Val;
            $this->session->set_userdata('testVal', $Val);
        }

    }

    /* Fin du fichier test_session.php */
    /* Emplacement: ./system/application/controllers/test_session.php */


views/test_session.php :

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    &lt;html &gt;
    &lt;head&gt;
    [removed][removed]
    &lt;/head&gt;
    &lt;body&gt;
    <div id="testDiv"></div>
    [removed]
    $(document).ready(function(){
        $('#test_link').click(function(){
            $('#testDiv').load('&lt;?php echo site_url('test_session/testLoad'); ?&gt;');
            return false;
        });
    });
    [removed]
    <a href="#" id="test_link">Test</a>
    &lt;/body&gt;
    &lt;/html&gt;


Normally when I click on $('#test_link') the value displayed should increment but in IE it doesn't work.

Can you help me please.

Thanks.


Messages In This Thread
Session problem when using jQuery.load() function - by El Forum - 01-16-2010, 04:27 AM
Session problem when using jQuery.load() function - by El Forum - 01-16-2010, 05:09 AM
Session problem when using jQuery.load() function - by El Forum - 01-18-2010, 01:13 AM
Session problem when using jQuery.load() function - by El Forum - 01-18-2010, 02:14 AM
Session problem when using jQuery.load() function - by El Forum - 01-18-2010, 02:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB