Welcome Guest, Not a member yet? Register   Sign In
AjaxFw (CJAX) not functionning
#11

[eluser]jhob[/eluser]
Did you ever get a resolution to this problem? I'm having the same issue, see http://ellislab.com/forums/viewthread/231351/
#12

[eluser]brizoo[/eluser]
Hi,

I'm sorry, I havn't forget to answer, I'm just in stand by because I'm working on something else for e while. I planed to answer to Ajaxboy and show an example on how I planed to use it.

I think this is not a problem, but more a misunderstanding of how works the framework.

For what I've understood, each time you want to make an ajax call you should place the call in your view and it should call a function in an ajax controller which is into the "Response" folder.

Until now, I was calling ajax directly in my views.

For example, have a look at this, it's one view that I'm using to handle error messages.
I have previously instanciated $ajax in my controller, which is a normal controller and not an ajax one. So I think there is the catch Wink

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

    $messages = $this->session->flashdata('message');
  
    if(isset($messages) and $messages != '')
    {
     if ( is_array($messages['text']))
     {
                foreach ($messages['text'] as $msg) {
      $ajax->warning($msg." Warning message...");
      //$this->firephp->warn($msg);
                }
     }
     else
     {
  $ajax->warning($messages['text']." Warning message...");
  //$this->firephp->warn($messages['text']);
     }

    }
?>

Am I wrong Ajaxboy ?

Thanks, and talk you soon, when I'll have more time.
#13

[eluser]Ajaxboy[/eluser]
Even though it might work in your views, I'd consider it good practice to place your ajax controller codes in your ajax controllers (not in the views), but if it works for you that way, its all good. It should also work on normal controllers ( as long you include the dependencies - ajax.php)




Theme © iAndrew 2016 - Forum software by © MyBB