Mark Drew (Redux)- cf_etc...

a compendium of railo, cfml, cfeclipse and technology topics

Mark Drew (Redux)- cf_etc...

Mental Note No. 4974: Use XMLFormat() when doing Ajax

February 1, 2007 ·

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 <pagelist>
... loop...
<page>
<id>#id#</id>
<pagename><![CDATA[#XMLFormat(pagename)#]]></pagename>
</page>


</pagelist>

Tags: coldfusion · personal

3 responses

  • 1 Ben Nadel // Sep 22, 2008 at 4:12 PM

    Mark,

    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.
  • 2 Mark Drew // Sep 22, 2008 at 4:12 PM

    It was failing on IE6 and IE7 ... go figure!

    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
  • 3 Ben Nadel // Sep 22, 2008 at 4:12 PM

    Sometimes IE just needs a &quot;Time out&quot; in the corner while the more mature browsers continue on with their fun and games.