CFDiv - Something To Watch Out For

Posted By : todd sharp Posted At : January 16, 2008 3:26 PM Posted In: Ajax, ColdFusion

6

Was just trying to create a super simple dynamic region on a page when I repeatedly received the following error when I loaded the page:

error:http: Error replacing HTML, element not found: comments

I double check everything and my bind statement looks good. View Source however told me something different. CF correctly included the Ajax 'plumbing' bits to create the div and register it, but my div itself was not in the source. Turns out the template I was working with had the following on line 1:

<cfsetting enablecfoutputonly=true>

So since cfdiv actually is creating a div behind the scenes it did not get output to the page because it wasn't surrounded in a <cfoutput>. Seems strange though because none of the other CF tags that generate HTML (IE cfinput) share this behavior. Unless I'm mistaken?

Comments (6)

Sam Farmer's Gravatar I think this must be the case with the new AJAX tags as I ran into this issues yesterday when using cflayout, cflayoutarea, etc

Dev's Gravatar When using cfdiv to load pages, if the css is included, only FF and Opera can successfully render the styled page, IE and Safari will only show the page without styles. Is that a bug ? or IE and FF doing ajax requests differently on the back ?

todd sharp's Gravatar Dev: Can you send me a sample reproducable case in email?

Dev's Gravatar hi todd,

I have put part of the code here
http://www.box.net/shared/luemef88cc
You may download it and have a look.

Notice that when you run the code in IE and FF, you will have a different result when you click on the Join Now button. So far only FF and Opera can render the css inside regForm.cfm, but IE and Safari (Win) just ignore it.

By the way, thanks for your concern and I hope the issue can be solved.

todd sharp's Gravatar Dev: Put your <style> from regForm.cfm in the head of index.cfm and you're all set.

Dev's Gravatar Well, I have been using this before. However, I need the loaded page's css to overwrite the original css rules in index.cfm . Therefore, I can't afford to do. By the way, thanks for your answer