Controller variable lost after change |
[eluser]Keylocker[/eluser]
I have a simple jquery progress bar that should get a variable from Codeigniter controller and print it on screen. The problem is that when a function changes that variable, the result is lost and so the progress bar shows 0. Here's my code: Code: class Emails extends CI_Controller { In jquery Code: function getProgress(){ The progress variable always comes back empty (NaN). Any suggestions? Thanks a lot guys.
[eluser]Keylocker[/eluser]
I'm sorry mate, didn't work. When I print the output from AJAX Code: $.get('<?=site_url("/emails/progress"); ?>', function(data) { I get this Code: <div solid #990000;padding-left:20px;margin:0 0 10px 0;"> The line 659 of course is the line that outputs the data in the progress() function
[eluser]Keylocker[/eluser]
Solved using session variable. Here's the correct code Code: public function __construct()
[eluser]Keylocker[/eluser]
[quote author="InsiteFX" date="1389223104"]PHP Static Variables[/quote] The function didn't set nor return the variable, actually don't know why. My workaround might not be beautiful, I admit, but it got the job done Client happy = everybody happy Thanks anyway for your hints mate |
Welcome Guest, Not a member yet? Register Sign In |