Welcome Guest, Not a member yet? Register   Sign In
What do you do for ajax requests?
#12

[eluser]FuzzyJared[/eluser]
http://community.xajaxproject.org/viewtopic.php?id=765

Here is a thread that explains how to get 5 beta release to work. I followed it and was able to get it working

Taken from post by Belarus, Brest

First, directory structure.
I've copy folder "xajax_js" from xajax 0.5 archive into the top-level folder without renaming. All files and subflolders from "xajax_core" i've copy to the application/libraries/ folder and rename xajax.inc.php into xajax.php.
Second, code.
File xajax_init.php is the same as in the CI wiki.
Controller testxajax.php looks like this

Code:
Code: PHP

<?php
Class Testxajax Extends Controller
{

    function Testxajax()
    {
      parent::controller();
    $this->load->library('xajax');
          $this->xajax->registerFunction(array('test_function',&$this,'test_function'));
          $this->xajax->processRequest();
    }
  
    function test_function($number)
    {
              $objResponse = new xajaxResponse();
          $objResponse->Assign("SomeElementId","innerHTML", "Xajax is working. Lets add: ".($number+3));
                  return $objResponse;
    }
    function index()
    {
        $template['xajax_js'] = $this->xajax->getJavascript('../../');

        $template['content'] = '<div id="SomeElementId"></div>&lt;input type="button" value="test" onclick="xajax_test_function(2);"&gt;';

        $this->load->view('template', $template);
  
    }
  

}
?&gt;


Messages In This Thread
What do you do for ajax requests? - by El Forum - 10-01-2007, 02:31 PM
What do you do for ajax requests? - by El Forum - 10-01-2007, 03:02 PM
What do you do for ajax requests? - by El Forum - 10-02-2007, 07:07 AM
What do you do for ajax requests? - by El Forum - 10-02-2007, 07:17 AM
What do you do for ajax requests? - by El Forum - 10-02-2007, 08:33 AM
What do you do for ajax requests? - by El Forum - 10-02-2007, 02:08 PM
What do you do for ajax requests? - by El Forum - 10-02-2007, 04:04 PM
What do you do for ajax requests? - by El Forum - 10-02-2007, 04:31 PM
What do you do for ajax requests? - by El Forum - 10-02-2007, 05:01 PM
What do you do for ajax requests? - by El Forum - 10-17-2007, 08:56 AM
What do you do for ajax requests? - by El Forum - 10-17-2007, 09:08 AM
What do you do for ajax requests? - by El Forum - 10-17-2007, 09:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB