ColdFusion Tag of the Week: CFSAVECONTENT
ColdFusion Tag of the WeekInspired by a recent post over at <cfsilence> and a handout Dave gave us at the last DFWCFUG meeting I decided I wanted to start a blog series. With this series of posts I hope to highlight a ColdFusion tag or function that people may have forgotten about or may not ever use. Or I may even highlight a tag that a lot of people use and that more should be aware of, <cfqueryparam> comes to mind. I will also use these posts to highlight codeShare, a project that Fro and I worked on and that Dave and Aaron did a great job integrating into InstantSpot . If you ever need to share code with someone over the Internet codeShare is a perfect place to do it. If you have any suggestions for a tag to highlight shoot me an email at ryan DOT Everhart AT gmail DOT com.
This may or may not get as loyal of following as Andy Jarrett’s Friday Jokes, but it’s worth a shot! So with out further delay the first every ColdFusion Tag of the Week!
This week’s tag is a tag that I’ve been using a lot of lately when writing AJAX with Rob Gonda’s ajaxCFC.
The Tag:
<cfsavecontent>
The Definition:
Saves
the generated content of the cfsavecontent
tag, including the results of evaluating expressions and executing custom tags,
in the specified variable.
The Tag Sample:
The Real Life Example:
The Uses:
Like I mentioned above I use this a lot when working with
AJAX. It allows me to write HTML code and send it back to the user thru
javascript as a string. This is MUCH
easier than trying to write HTML code using javascript. Another use for it may
be to create content for use in a <cfmail>. There are some situations where you may need
to output more than one query within a <cfmail> tag and its not always
possible. However with
<cfsaveconent> it is possible, in fact your <cfmail> tag may even
look a bit cleaner if you use <cfsaveconent>
The Bonus Code:
Good Day!
Ryan





Loading....