ReplaceNoCase <cfoutput> in Javascript

I use a <cfoutput> within a Javascript script:


var audioPlaylist = new Playlist("1", [
	<cfoutput query="getPlayList"> 
		{
			name:"#getPlayList.track_name#",
			mp3:"http://kappa.bgmultimediaserver.net/release_tracks/#track_file#",
			lyrics: "#ReplaceNoCase( getPlayList.track_lyrics, chr( 13 )&chr( 10 ), '<br />', 'all')#" 
		} 
	<cfif getPlayList.CurrentRow lt getPlayList.RecordCount>,</cfif> 
	</cfoutput>
],

The plugin I’m using doesn’t support any HTML formating and I was adviced to use my serverside scripting to return line breaks and for converting any HTML special characters. As you can see do I use ReplaceNoCase, but instead of returning the actual line breaks, The <cfoutput> gives me the line break characters instead like <br /> <br /> .

Is there anyone arround familiar with integrating CF in Javascript and how I can solve this?

Thank you in advance

I’m guessing ReplaceNoCase isn’t working the way you think it should, and this has nothing to do with javascript

try it like this –


<!--- first make Windows style into Unix style --->
<CFSET variables.lyrics = REPLACE(getPlayList.track_lyrics,chr(13)&chr(10),chr(10),"ALL")>
<!--- now make Macintosh style into Unix style --->
<CFSET variables.lyrics = REPLACE(variables.lyrics,chr(13),chr(10),"ALL")>
<!--- now change breaks to BR tags --->
<CFSET variables.lyrics = REPLACE(variables.lyrics ,chr(10),"<br>","ALL")>

Hi Rudy. It keeps giving me the <br> characters? I presume I had to place those <cfset’s> within the <cfoutput>?
for the good order this is insert:


INSERT INTO `release_tracks` (`track_id`, `release_id`, `track_name`, `track_lyrics`, `track_file`) VALUES
(1, 1, 'Hopesong', 'Song 1\\r\
\\r\
lijn 2\\r\
\\r\
lijn 3', '01 Hopesong.mp3');

um, yeah, because the first CFSET uses getPlayList.track_lyrics

note you will be printing #variables.lyrics# after the CFSETs