In coldfusion I have this part of the jquery ui slider script:
$("#slider-range_sun").slider({
range: true,
min: 0,
max: 1440,
step: 15,
values: [375, 1020],
The last line where it says values: [375, 1020] I need to set the numbers with coldfusion variables that are coming from the DB. Putting cfoutput around that line and outputting the variables with pound signs breaks the jquery. Any thoughts on how to do this?
CodePudding user response:
If this is all just inline JavaScript in a CFM file, you can do this to avoid the jQuery selector entirely:
$("#slider-range_sun").slider({
range: true,
min: 0,
max: 1440,
step: 15,
values: <cfoutput>[#variableA#, #variableB#]</cfoutput>,