February 18th, 2008 by
Ken
So here’s something that had been a bit of a headache for me. I do my ColdFusion development on a local server on my laptop with debugging turned on. Now, when you make calls to a script, ColdFusion adds 2 links (and a bunch of javascript) to the bottom of each page. These 2 links are a huuuge pain when you use the Coldfusion pages for AJAX calls.
In my case, I was getting “div has no properties” errors in the Firefox error console.
What happens is, well. I don’t really know for sure, but I DO know how to fix it.
For any scripts that you’re going to use for AJAX GETs, start off with:
<cfsetting showdebugoutput=”no” />
And end with:
<cfabort />
This will save you a ton of headaches in the end. I don’t know why just the cfsetting doesn’t work but without the cfabort at the end, the links still appear.
Posted in Coldfusion, Development, jQuery |
No Comments »
April 23rd, 2007 by
Ken
I’m not certain how many of you guys out there are programmers, let alone Coldfusion programmers… But I’ve had this problem for a while now and haven’t been able to figure this out so I’m reaching out to my readers to see if anyone has any ideas.
What I’m trying to do is build a templating system in Coldfusion where I would replace a variable with the contents of another processed Coldfusion file. So let’s say I have two files…
hello.cfm
<cfset message = "Hello World!" />
<cfoutput>#message#</cfoutput>
caller.cfm
<cfset bodyText = "this is some text from hello.cfm :: %hello%" />
<cfoutput>#bodyText#</cfoutput>
So what I want now is to replace %hello% with the output of hello.cfm so that in the end, I’ll get the output “this is some text from hello.cfm :: Hello World!
Hope someone out there will see this and have an answer or at least some ideas to get the juices flowing
Thanks!!
UPDATE: LOL, okay so I figured it out.
caller.cfm
<cfset bodyText = "this is some text from hello.cfm :: %hello%" />
<cfsavecontent variable="varHello">
<cfinclude template="hello.cfm" />
</cfsavecontent>
<cfset bodyText = replace(bodyText, "%hello%", varHello, "ALL") />
<cfoutput>#bodyText#</cfoutput>
Now I just need to make this cleaner so that I load just the files I need instead of all of them and assigning them to variables. Any comments would still be greatly appreciated!
Posted in Coldfusion, Development, How To |
No Comments »