CodeIgniter Forums
Ajax Updater should work on js function call... But it dont... - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Ajax Updater should work on js function call... But it dont... (/showthread.php?tid=7521)



Ajax Updater should work on js function call... But it dont... - El Forum - 04-12-2008

[eluser]Rubiz'[/eluser]
Hi!! I'm trying to do a Ajax Updater function outside button click; I had to do this in a normal javascript function, I'm trying like that:

Code:
<!--
    function setAdress()
    {
        var adress = '<?=base_url()?>index.php/email/preview/' + $('id_category').getValue();
        new Ajax.Updater('preview', adress ,{evalScripts:true});
    }
-->

It should work, don't?
Its not working... anyone knows why?


Ajax Updater should work on js function call... But it dont... - El Forum - 04-12-2008

[eluser]wiredesignz[/eluser]
This won't help your current problem, but base_url() is really for asset linking, site_url() is for application links. If index.php is ever renamed by someone using your code it will fail here.


Ajax Updater should work on js function call... But it dont... - El Forum - 04-13-2008

[eluser]Rubiz'[/eluser]
Your suggestion is really cool wired, thanx!
I discovered it have to be set a method... I set method:'post' and now it works very well Big Grin