Okay, I feel like I’m close to finally having this working, but a final hurdle still has me stumped. All of the provided CJAX examples are working for me. When I try to mimic the click_ajax_request example in my setup, I’m not getting a response.
I have a main controller
application/controllers/click_ajax_request.php
<?php
class click_ajax_request extends MY_Controller {
function index()
{
$this->load->view('click_ajax_request');
}
}
This loads my view
application/views/click_ajax_request.php
<?php
$this->load->file(FCPATH.'ajaxfw.php');
$ajax = ajax();
$ajax->click("link1",$ajax->call("ajax.php?click_response/click_link/hello"));
?>
<html>
<head>
<meta http-equiv="Content-Type" c charset=utf-8">
<title>Simple ajax request binded to a link</title>
<?php echo $ajax->init();?>
</head>
<body>
<h2>Simple ajax request binded to a link</h2>
<p><a href="#id=link1">Link 1</a><br />
<div id="response"><br />
</div><br />
</body><br />
</html>
Which, upon clicking the link, is supposed to call my ajax controller
application/response/click_response.php
<?php
class click_response {
function click_link($message)
{
$ajax = ajax();
$ajax->success("You clicked the link.. $message");
}
}
The view loads properly and it looks like Ajax is initializing properly with no errors in the inspector. Each time the link is clicked, the console prints:
_call waits : caller: set.event cjax-5.5.min.js:278
Call executed. cjax-5.5.min.js:377
Waiting for response..
but the response never comes. The Chrome Network tab reports a 200 Status GET request has been fired, with the path
http://dev.my-project:8888/ajax.php?click_response/click_button/hello
Any idea what I’m missing here? I can’t seem to get the ajax response to come back, even though when I try the straight CJAX example it works fine.
Using: Codeigniter 2.1.4, AJAXFW 5.5