!--- get a list of all external customers for AJAX calls ---
cffunction name=AJAXgetAllCustomers access=remote output=false
returnformat=json
!--- create a struct to hold our local variables. ---
cfset var loc = structNew()
!--- returns a query. ---
cfset loc.custList = getAllCustomers() /
Thanks Brian. That eliminated all of the RegEx I was having to do, but
my closing list tag is now being displayed as \\\/li at the end of
every list item, and all slashes in my text are showing up as \\\/.
Any idea on how to fix that?
Thanks,
Eric Cobb
ECAR Technologies, LLC
One question I do have though, why not just return the query as an object
and use javascript to build li list items? This would be less load on the
server, less data to transmit over the interwebs and ultimately faster.
On Thu, Jun 10, 2010 at 9:26 AM, Michael Grant mgr...@modus.bz wrote:
If Eric is returning a plain string, then there is no need to
SerializeJson() the result, as all he needs is the string. That is why
Eric is getting the additional slashes in his closing tag, because the
SerializeJson() method is automatically escaping the slash characters.
I'll agree with
If Eric is returning a plain string, then there is no need
to SerializeJson() the result
Too right. That was an artifact from using Eric's example.
~|
Order the Adobe Coldfusion Anthology now!
I originally thought about just parsing the return in jQuery, until I
realized what this code was ultimately going to have to do. The items
in this list are actually going to wind up having text hyperlinks, form
buttons, and maybe even images added to them, so for me it's easier to
build it
It's about being ajaxy in the right places.
You can be ajaxy without using jQuery as well. If you only want jQuery to do
the ajax calls and all you want to do is dump html (into a div or other dom
object) that's been compiled on the server just write your own to get the
http object?
On Thu,
In your cfsavecontent, get rid of all the tabs and carriage returns. This
will make your code less readable, but it should take care of the problem
you're having.
So it might end up looking like this:
cfsavecontent variable=loc.rtnContentcfoutput
Just a note that your list item has no closing tag.
You can try building up the string with assignments rather than using
cfsavecontent. i.e.:
cfoutput query=loc.custList
cfset local.result = local.result li#Trim(loc.custList.full_name)#
- #Trim(loc.custList.addr_line1)#,
9 matches
Mail list logo