Welcome Guest, Not a member yet? Register   Sign In
Output compression and AJAX
#1

[eluser]EEssam[/eluser]
Hello,

I have some functions that output somethings like 'YES' no 'NO' via echo just to inform jQuery about the AJAX request result but when I'm activating CI compression via config it's not working.

What are the suggested solutions?

Thanks.
#2

[eluser]Dam1an[/eluser]
Remove the echo statements Tongue
The config file clearly states you can't echo any output

Quote:VERY IMPORTANT: If you are getting a blank page when compression is enabled it
means you are prematurely outputting something to your browser. It could
even be a line of whitespace at the end of one of your scripts. For
compression to work, nothing can be sent before the output buffer is called
by the output class. Do not "echo" any values with compression enabled.

You shouldn't really echo anything anywhere other then in the view if you're doing pure MVC Tongue
#3

[eluser]TheFuzzy0ne[/eluser]
Try:
Code:
$this->output->set_output('YES');
#4

[eluser]EEssam[/eluser]
[quote author="TheFuzzy0ne" date="1244662501"]Try:
Code:
$this->output->set_output('YES');
[/quote]Awesome, thanks.




Theme © iAndrew 2016 - Forum software by © MyBB