An odd cfdiv issue

This post is more than 2 years old.

Forgive the vague title, but the title I wanted to use would reveal the secret behind the mystery that plagued a reader of mine for the past few days. He was using cfdiv to load dynamic content and discovered that the content would loop itself in a loop. What do I mean?

Imagine a page with one cfdiv using bind="url:content.cfm". You would expect that when the page loaded, there would be one HTTP request to load content.cfm. Instead, he was seeing the following (and again, for Mac Firefox users, click the upper left hand triangle if you don't see a big play button):

What you are seeing here is a few reloads and the Ajax loads normally, and then all of a sudden the last reload causes an infinite reload as reported by Firebug.

I had no idea what the problem was until my reader mentioned he was using SES urls. Guess what - that was the issue. I simply added /x/1 to my URL (for example: http://localhost/test.cfm/x/ismell).

If you think about it, it kind of makes sense that a cfdiv with this url "test.cfm", isn't qualified and would be a problem. However, I would not have guessed tht it would cause the constant looping as is shown above.

The fix, of course, is to change the cfdiv to use a full url:

<cfdiv bind="url:/data.cfm" />
Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA

Archived Comments

Comment 1 by BA posted on 1/10/2009 at 9:16 AM

I wish I could help but I haven't moved up to CF 7 yet :)


Comment 2 by Gurpreet posted on 7/4/2010 at 11:34 AM

How do i bind an additional parametr like:

<cfdiv bindOnLoad="False" bind="url:checkuser.cfm?email_addr={email_addr},sting=1" ID="theDiv1" style="color:red;"/>

checkuser.cfm is a file which have two queries, one it matches the username and that is matched when no sting=1 is passed, now in the same file, i have called the <cfif isdefined('url.string') and url.sting IS 1>
query to match the email goes here

but it returning empty results! i mean displays nothing in firebug

i think i am doing something horribly wrong

Comment 3 by Gurpreet posted on 7/4/2010 at 12:15 PM

solvedi it!

used & instead of ,