Welcome Guest, Not a member yet? Register   Sign In
How integrate XAJAX in CI ??
#4

(This post was last modified: 04-02-2015, 11:38 AM by ciadmin.)

[eluser]PoWah[/eluser]
Ok, library loads, but the example not working Sad
What I do wrong? Here is the code:

application/controllers/testajax.php
Code:
<?php
Class Testajax Extends Controller
{
    function Testajax()
    {
    parent::controller();
    $this->load->library(\"xajax\");
    $this->xajax->registerFunction(array(\'test_function\',&$this,\'test_function\'));
    $this->xajax->processRequests();
    }
    
    function test_function($number)
    {
        $objResponse = new xajaxResponse();
        $objResponse->addAssign(\"SomeElementId\",\"innerHTML\", \"Xajax is working. Lets add: \".($number+3));
        return $objResponse->getXML();
    }
    
    function index()
    {
        $template[\'content\'] = \'<div id=\"SomeElementId\"></div>
                                &lt;input type=\"button\" value=\"test\" onclick=\"xajax_test_function(2);\"&gt;\';

        $this->load->view(\'template\', $template);
    }
}
?&gt;

The view file is very simple with a static link to xajax.js and it only echos $content variable.

Debug message \"xajax_test_function is not defined\".
You can see it in action here: http://laikinas.vai.lt/mobilu.lt/index.php/testajax


Messages In This Thread
How integrate XAJAX in CI ?? - by El Forum - 06-21-2007, 06:52 AM
"How integrate XAJAX in CI ??" - by El Forum - 06-21-2007, 09:52 AM
"How integrate XAJAX in CI ??" - by El Forum - 06-22-2007, 12:29 AM
"How integrate XAJAX in CI ??" - by El Forum - 06-22-2007, 01:17 AM
"How integrate XAJAX in CI ??" - by El Forum - 06-22-2007, 02:39 AM
"How integrate XAJAX in CI ??" - by El Forum - 06-22-2007, 05:25 AM
"How integrate XAJAX in CI ??" - by El Forum - 06-23-2007, 02:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB