[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Passing a variable from CF8 to Javascript - How?

Posted on 2008-11-19
6
Medium Priority
?
258 Views
Last Modified: 2013-12-16
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
Comment
Question by:Sci-Fi-Si
  • 3
  • 2
6 Comments
 
LVL 9

Accepted Solution

by:
Andrew Maurer earned 520 total points
ID: 23000481
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
 
LVL 9

Assisted Solution

by:Andrew Maurer
Andrew Maurer earned 520 total points
ID: 23000488
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
 
LVL 27

Assisted Solution

by:azadisaryev
azadisaryev earned 280 total points
ID: 23001537
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 9

Expert Comment

by:Andrew Maurer
ID: 23001546
azadisaryev is right, double that first # sign.
0
 
LVL 9

Author Comment

by:Sci-Fi-Si
ID: 23009819
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
 
LVL 9

Author Closing Comment

by:Sci-Fi-Si
ID: 31518548
Thanks very much for that!
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Geo-targeting is the practice of distributing content based on a person’s location, as best as you can determine it. Let’s look at some ways you could successfully use this tactic. The following tips and case studies could lead to meaningful results.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses
Course of the Month19 days, 16 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question