Ajax Framework (CJAX) for Codeigniter 2.x+ |
[eluser]MonsterTKE[/eluser]
[quote author="Ajaxboy" date="1340616947"]It is recommended to use firebug (https://getfirebug.com/) for quick error debugging, it appears the path for the js lib is incorrect,So the js lib is not being loaded. [/quote] I had included the script in the head tag as was mentioned in a different post. If I include <?php echo $ajax->init();?> in the head tag it errors out. It shows the script as loaded but it errors with "Call to undefined function ajax() in /var/www/application/views/templates/header.php on line 1"
[eluser]Ajaxboy[/eluser]
The place where it was it is fine. but the path was wrong.. try this: Leave it where it was, but do it like this: Code: <?php echo $ajax->init('http://monstertke.zapto.org/');?> As mentioned in the documentation: http://cjax.sourceforge.net/docs/Iniciat...Engine.php
[eluser]MonsterTKE[/eluser]
Code: <$cript defer='defer' id='cjax_lib' type='text/javascript' src='cjax/core/js/cjax-5.0-RC2.min.js'>[removed] In the head tag works fine... for the front page only. Code: <$cript id='cjax_lib' type='text/javascript' src='cjax/core/js/cjax-5.0-RC2.min.js'>[removed] s changed to $ so it would let me post. As mentioned in the documentation throws an ajax error. "process unable to load function" the $ajax->init(http://monstertke.zapto.org/); Just throws a "Call to undefined function ajax()" Code: <?php $ajax = ajax(); echo $ajax->init(http://monstertke.zapto.org/); ?>
[eluser]Ajaxboy[/eluser]
Make sure you add quotes in the url: 'http://monstertke.zapto.org/'
[eluser]MonsterTKE[/eluser]
[quote author="Ajaxboy" date="1340619765"]Make sure you add quotes in the url: 'http://monstertke.zapto.org/' [/quote] Sorry for the issues Ajaxboy but its still not working. "vendors/index" Code: public function index() { Code: <?php $this->load->helper('text');?> Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> And the ajax function it is supposed to call. Code: class votes_comment extends CI_controller {
[eluser]MonsterTKE[/eluser]
<?php $ajax = ajax(); echo $ajax->init("http://monstertke.zapto.org/"); ?> for that part, I have done it every way, single quotes, double quotes, no quotes "base_url() etc.
[eluser]Ajaxboy[/eluser]
It works fine for me (shows the overlays, but not content). There is a 500 error, meaning there is an error in your php syntax within http://monstertke.zapto.org/auth/login You might want to turn on error display in php or look at your apache error log. This is a php error in your php syntax.
[eluser]Ajaxboy[/eluser]
There is another way to specify the url: in file Quote:cjax/config.default.php find setting: Code: $config->init_url then change it to: Code: $config->init_url = 'http://monstertke.zapto.org'; then rename the file 'config.default.php' to 'config.php', then you won't need to enter the url in Code: $ajax->init()
[eluser]MonsterTKE[/eluser]
meh, with the script source set manually in the head tag clicking one of the red/green links in the listings overlays the tank auth view like it is supposed to. So does clicking on "login" The 500 error you were seeing was it spinning on "[client 76.203.***.***] PHP Fatal error: Call to undefined function ajax() in /var/www/application/views/templates/header.php on line 13" Which is what it does whis the $ajax->init(url); part in place. It is working fine and doing exactly what I want it to do except for not making the correct connections on the paginated results.:down: Ill try explicitly setting the url in the config.
[eluser]MonsterTKE[/eluser]
[quote author="Ajaxboy" date="1340621366"]There is another way to specify the url: in file Quote:cjax/config.default.php find setting: Code: $config->init_url then change it to: Code: $config->init_url = 'http://monstertke.zapto.org'; then rename the file 'config.default.php' to 'config.php', then you won't need to enter the url in Code: $ajax->init() Damn.. Is there a way to autoload the ajax.php file? Auth/login is trying to call the function due to the header template being loaded. |
Welcome Guest, Not a member yet? Register Sign In |