Welcome Guest, Not a member yet? Register   Sign In
XAJAX Test_Function is not defined
#4

[eluser]InsiteFX[/eluser]
It Could be a problem with the sessions and the ajax call.
You may need to play with this for xajax.

Create the MY_Session file below.
1) CI 1.7.2 - Place in application/libraries/MY_Session
2) CI 2.0 - Place in application/core/MY_Session

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
* ------------------------------------------------------------------------
* CI Session Class Extension.
* ------------------------------------------------------------------------
*
* Add the following define to the bottom of application/config/constants.php
* // Define Ajax Request
* define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
*
*/

class MY_Session extends CI_Session {
   /*
    * Do not update an existing session on ajax calls
    *
    * @access    public
    * @return    void
    */
    public function sess_update()
    {
        if ( ! IS_AJAX)
        {
            parent::sess_update();
        }
    }

    function sess_destroy()
    {
        parent::sess_destroy();

        $this->userdata = array();
    }

}

// ------------------------------------------------------------------------
/* End of file MY_Session.php */
/* Location: ./application/libraries/MY_Session.php */

InsiteFX


Messages In This Thread
XAJAX Test_Function is not defined - by El Forum - 11-15-2010, 07:37 PM
XAJAX Test_Function is not defined - by El Forum - 11-15-2010, 10:54 PM
XAJAX Test_Function is not defined - by El Forum - 11-16-2010, 04:23 AM
XAJAX Test_Function is not defined - by El Forum - 11-16-2010, 06:33 AM
XAJAX Test_Function is not defined - by El Forum - 11-16-2010, 06:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB