You and Anna/MediaGirl hit on the issue. Currently EE's output class only disables the template debugger and output profiler on responses sent through its own
send_ajax_response() method (which makes certain assumptions about the response itself.) Hopefully EllisLab will build in some additional ajax response options to the Output class in the future.
Until that time, I put together a simple plugin that allows you to surpress the template debugger and output profiler as needed. I'm not putting it anywhere because it's probably somewhat of an edge case. Here's the info:
- Create a directory called
disable_profiler in your
- Create a file called
pi.disable_profiler.php in this new directory
- Here's the code for that file: https://gist.github.com/4206180
- Add this tag to your templates loaded over ajax:
You can tweak the code as needed, if you'd rather there be an ajax request logic. I ran this locally with a
$.load() jQuery snippet and it seems to work fine. The main/master template keeps the output profiler but the loaded templates do not and thus do not break the master one.
Per a tweet it looks like there's an add-on that has this behavior among other features. You just install it and it "fixes" this issue for all template requests (per the author's tweet).
Add-on info: http://devot-ee.com/add-ons/ee-debug-toolbar
Tweet reference: https://twitter.com/mithra62/status/276025536717914113