• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

Passing a variable from CF8 to Javascript - How?

Hello Experts!

I'm trying to pass a variable into a JavaScript from ColdFusion8 but am not sure how to do this can any one help?

<script type="text/javascript">

      AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,12,36','width','1024','height','424','src','flash/#MYCOLDFISIONVARIABLEHERE#','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','flash/#MYCOLDFISIONVARIABLEHERE#','wmode','transparent' ); //end AC code

</script>

Many thanks!
0
Sci-Fi-Si
Asked:
Sci-Fi-Si
  • 3
  • 2
3 Solutions
 
Andrew MaurerCommented:
Welll you would just make sure it is on a ColdFusion page, and wrap it in a cfoutput tag


<cfoutput>
 
<script type="text/javascript">
 
      AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,12,36','width','1024','height','424','src','flash/#MYCOLDFISIONVARIABLEHERE#','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','flash/#MYCOLDFISIONVARIABLEHERE#','wmode','transparent' ); //end AC code
 
</script>
 
</cfoutput>

Open in new window

0
 
Andrew MaurerCommented:
now if you are trying to have a CF page that make javascript calls to  a CF server, maybe using httprequest.. then thats a whole different lesson...
0
 
azadisaryevCommented:
if you are wrapping the whole <script></script> block in <cfoutput>, don;t forget to double that # in swflash.cab#version!
alternatively, you can wrap just the cf variables in <cfoutput>...
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
Andrew MaurerCommented:
azadisaryev is right, double that first # sign.
0
 
Sci-Fi-SiAuthor Commented:
Superb!

Thanks to all of you for your replies - you stars! I've got my site up and running with a theme for each day now which looks cool...

Again many thanks.
0
 
Sci-Fi-SiAuthor Commented:
Thanks very much for that!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now