During my presentation on Wednesday concerning Ajax and ColdFusion 8, someone asked about degradation when JavaScript was turned off. What I had said was that I had not tested it, but I assumed that while stuff would render, anything dynamic would not work, including remote content. So for a text I showed this:
<cfpod source="test2.cfm" test="Status" />
I loaded it up in the browser and confirmed that test2.cfm loaded. I then disabled JavaScript and reloaded the page. The pod rendered just fine, but was now empty.
Now for the cool part. I changed my code to:
<cfpod source="test2.cfm" title="Status">
You need to enable JavaScript.
</cfpod>
I reloaded the page and there was my warning. I re-enabled JavaScript, reran the page, and test2.cfm showed up! You could, in theory, use this for simple JavaScript detection. If test2.cfm had a cflocation in it, you could then use this code to warn the user that they must enable JavaScript to continue. Not sure if that is a great idea - but it seemed like a neat trick.
Archived Comments
so is a cfPOD, simply a scrolling div with a header and some fancy stuff? just wondering? cool little tag, i just tried it and it works cool, i guess i just dont see TOO MUCH purpose in it?
Yep - it IS just a simple thing, but I think you see the UI used often. MOst sites have "things" in the nav that are square like. I do. And cfpod is a good way to encapsulate that. Also - I've seen cfpod used like a form fieldset and I think it works nicely that way.