Ajax Framework (CJAX) for Codeigniter 2.x+ |
[eluser]gwatt[/eluser]
Hi, There is no big rush. Now that I know I can write a function to build relative links I can start working. I have hardly used CJAX yet so when I get some of system working using CJAX and understand how it works in CI I will definitely write a review. This issue has confused me for a month so I don't want other people to have the same issue. Any testing around this issue would be great. The easier it is to use in CI the better. G
[eluser]Needle[/eluser]
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 Code: <?php This loads my view application/views/click_ajax_request.php Code: <?php Which, upon clicking the link, is supposed to call my ajax controller application/response/click_response.php Code: <?php 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
[eluser]Alexlv4[/eluser]
Hi I am new using CJAX. I want to propagate two dropdown dependent empresa -> programa -> grupo I try using this Code: $ajax->change("select_empresa",$ajax->call($ajax_relativa."ajax.php?tantum/programa_select/|select_empresa|")); My controller in response folder is Code: function programa_select($selected) But just the first works fine it is posible? What i am doing wrong? Thanks in advance
[eluser]Alexlv4[/eluser]
Hi again. Well I solve my problem. I just add an option with value 0 and works fine Code: function programa_select($selected) Thanks for CJAX is awesome and easy to use
[eluser]Ajaxboy[/eluser]
@needle I was just made aware of a possible issue in some servers , At this point I am not sure what is producing it but it might be the version of php 5.3, not 100% sure. This issue some times prompts you to get a blank page. If this is the same issues, here is the fix: In file cjax/cjax.php line 36: Change: Code: $file = preg_replace("/.+\//",'', $_SERVER['SCRIPT_NAME']); Code: $file = preg_replace("/.+\//",'',ltrim($_SERVER['SCRIPT_NAME'],'/')); I believe this will take care of your issue.
[eluser]Needle[/eluser]
Yes, that cjax.php fix appears to have done it! Responses are now coming through as they should. I can't tell you how pleased I am to finally have this working, I was beginning to think I was crazy! Thanks very much for your help Ajaxboy. CJAX looks like a fantastic framework and I will definitely leave a review once I've had a chance to play with it a bit more.
[eluser]Ajaxboy[/eluser]
[quote author="Fredrik-s" date="1377037588"]Hello, I also encounter the problem with the "blank page". My setup: PHP Version 5.3.10-1ubuntu3.6 CodeIgniter 2.1.4 AJAXFW_4CI_5.5 Im running "clean URLs". I have followed the solution in this thread: http://ellislab.com/forums/viewthread/220620/#1016536 I get a "200 OK" when checking the network tab in Chrome. Im calling the following URL to test Cjax: http://mydomain.com/ajax/test/test My file structure looks like this: root -.htaccess -ajax.php -ajaxfw.php -application --controllers ---AjaxController.php --response ---sample.php ---test.php -views --test.php --test2.php -cjax htaccess: Code: Options -Indexes I dont get any PHP errors in my error.log. And nothing displays when reaching http://mydomain.com/ajax/test/test just a blank page. Not either any JS errors in console tab in Chrome. What am I doing wrong and how should I fix it? [/quote] I above solution should also solve your problem. This will be included in the next maintenance release. @needle Glad everything is working for you. |
Welcome Guest, Not a member yet? Register Sign In |