Model-Glue with Ajax - Watch Your Debug Output

Posted By : todd sharp Posted At : July 19, 2007 8:05 AM Posted In: Model-Glue, Ajax

5

Sorry about the non-creative title for the post. So last night I was working on a MG application and came across a bit of Spry in my page that would not work. I goofed around a bit with the code, assuming I had done something wrong. Double checked that the Spry libs were being included - yep. I checked everything - nothing seemed off. Then (after an hour) I remembered that I had read somewhere in my Model-Glue research that having debugging turned on can interfere with JavaScript. If you've done any work with MG you'll know that your views are actually rendered within the debug output - which means your JS is potentially included more then one time. Sure enough, turning off debug output did the trick and everything was back on track. Just another bump in the road on the path to MG enlightenment.

Comments (5)

Boyan's Gravatar I'm sure I've read this somewhere too but had forgotten. Thank you for the reminder Todd.

Joe Rinehart's Gravatar Little discussed tidbit:
Do a <cfset request.modelGlueSuppressDebugging = true /> and it'll shut off debugging during that request...

todd sharp's Gravatar Joe - at the risk of embarassing myself - why not just a cfsetting?

Wait I get what you're saying that would shut off the MG debug output too. But the MG debugging was not goofing me - turning off the CF debugging worked. Am I missing something?

Jeffry Houser's Gravatar I modified the CF Debug Template to address this limitation.

More info here:

http://www.jeffryhouser.com/index.cfm/2007/1/10/CF...

Jeffry Houser's Gravatar And for the sake of letting you know, I got an error when submitting the previous comment.