Mental Note No. 4974: Use XMLFormat() when doing Ajax
Posted At : February 1, 2007 9:13 AM
| Posted By : Mark Drew
Related Categories:
coldfusion,
doh!
There is an application I built using some Spry related drop downs. It has been working for months (since the summer really) fine and all of the sudden the drop down boxes disappeared. Without going too much into what it does, its basically a page list and it stopped working.
After a lot of checking config and what have you, it basically come down to Internet Explorer chocking on the page names, even though they were in a CDATA block it still didn't like them.
To cut a long story (of debugging, using a lot of profanity and most of the characters above the numbers on a keyboard) short, if you are not in control of what is going to be in your XML, add XMLFormat() to your output
... loop...
<page>
<id>#id#</id>
<pagename><![CDATA[#XMLFormat(pagename)#]]></pagename>
</page>
</pagelist>



Interesting tip! I am curious what version of IE you are using. I never thought of doing that. I just assumed that CDATA would take care of all that business. I guess I should go update my RSS feed.
I couldn't spot which character it was, since when I tried to view source in IE, it just cried and sulked in a corner