The best way I've found is to use CFSAVECONTENT and jsStringFormat() like
so:

<cfsavecontent variable="temp">
big long nasty string
that contains cf process,
and whatever else
</cfsavecontent>
<cfoutput>
  document.write("#jsStringFormat(trim(temp))"#);
</cfoutput>

Cheers,
barneyb

> -----Original Message-----
> From: cf coder [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 27, 2004 10:00 AM
> To: CF-Talk
> Subject: how to output the following code using document.write?
>
> Hi Guys, I want to display the below inside the _javascript_
> document.write function. Please, please can someone show me
> how to do this. I've tried but I keep getting
> "unteminated string constraint" _javascript_ msg
> <a
> href=""> > r#&linksPopUp=true' , 740 , 430)" class="link"><acronym
> title="#Slug#"><cfif Comments neq "">#Comments#<cfelseif
> Find('#Chr(13)#',Slug)><cfset
> tmp=REReplaceNoCase(Slug,'^[^a-z0-9_]*([a-z0-9_])','\1')>
> <cfif trim(Find('***',tmp)-1) neq 0 and Find('***',tmp) and
> trim(Left(tmp,Find('***',tmp)-1)) neq ""><cfset str =
> REReplace(Slug,"^\s*([*]{3}.*?[*]{3})?\s*","")><cfset str =
> REReplace(str,"^(.*?)\s*[*]{3}.*$","\1")>#str#<cfelseif
> trim(Find('#Chr(13)#',tmp)) neq 0 and
> trim(Left(tmp,Find('#Chr(13)#',tmp))) neq
> "">#trim(Left(tmp,Find('#Chr(13)#',tmp)))#<cfelse>#tmp#</cfif>
> <cfelse>#Left(Slug,25)# ...</cfif></acronym></a>
>
> Many thanks in advance
> Best regards,
> cfcoder
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to