Moderator’s note: Split from this thread.
I too am having this problem, and am glad I have found this thread.
I am running 1.6.3, Build: 20080421
My hosting for this project is through HostGator.
I have not upgraded, but am starting a fresh site with this build.
The site was fully designed and coded, with html, css, and javascript all standards compliant and error free, and in perfect working order on a test server.
One of my first acts on the fresh install was to turn on the Debug preference to ‘1’, and set ‘Display SQL queries’ and ‘display template debugging’ to ‘yes’.
Once I began moving these files into EE templates, I noted a series of problems (this is my 5th EE site, so I am not totally inexperienced). What follows is a walkthrough of my experience:
1) I set up javascript files as external files in a javascript directory on the server to begin, planning to move then into template type ‘javascript’ templates later in the process. This is still with debug preferences set to 1.
2) at some point last evening, in the midst of working on a separate issue, I set debug preferences to 0, and set ‘Display SQL queries’ and ‘display template debugging’ to ‘no’ to simply shorten the outputted screen height a bit ... not thinking much about it at the time.
3) I didn’t notice that the javascript had stopped working right away, and when I did discover that there was a problem, I didn’t even think it could be the debug preferences and instead went about looking for the problem in possible code / template changes that I had made. I eventually found that while the full javascript files were in separate external files in a directory on the server, I was using some global variables to hold some javascript ‘triggers’ common across the site at the bottom of the templates. These ‘triggers’ were having everything between their { brackets } removed by EE upon output, and therefore the javascript functions were not getting properly called. This setup had been working fine previously, and were not fixed when moving those triggers directly into the template, rather than calling the global variable. I puzzled over what might have changed until I found this thread ...
4) Reading about the connection with the debug preferences in this thread, I changed the setting back to ‘1’, and all problems are solved - that is, the javascript ‘triggers’ are being outputted properly (not stripped of content between the { brackets }). I should note, this setting affects all A-grade browsers on pc, whether logged into the site or logged out - so even when logged out (and the debugging is not being shown to you) the setting has effect. If it is set to ‘1’, everything works. If it is set to ‘0’, javascript { bracketed } code is stripped out.
In conclusion, I am happy to do what I can to support a resolution to this issue, as I don’t want to hand this project over to my clients with debugging info streaming onto their pages when logged in as super-admins.
The ideal solution will allow me to run javascripts through EE as javascript template types smoothly, with both debugging set to either 0, 1, or 2 - though by far the most important to me right now is getting things to work with it set to ‘0’, since that is what currently doesn’t work, and the state of things desired for delivering the project to my client.
—edited for clarity—L.A.