|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
i have a .js file that's included in a template. within this .js file i have something like
<cfoutput>#cgi.server_name#</cfoutput> for some reason this doesn't work. is that mean that you cannot use <cfoutput> and CF variables in an included .js file ? thanks for the help in advance |
|
#2
|
|||
|
|||
|
You can't use <cfoutput> tags or any coldfusion tags, for that matter, within a .js file. I have set up files in the past where I set up the coldFusion-dependent variables within my .cfm page and then pass it via javascript.
So somewhere above I would include this global variable. var myvariable = #cgi.server_name#; and later call the .js file |
|
#3
|
|||
|
|||
|
thank you very much
|
|
#4
|
|||
|
|||
|
You can also just have a CF template or CFC that generates the Javascript dynamically and pushes it into the header with <cfhttphead>, instead of using a separate .js file.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > <cfoutput> and .js question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|