RE: CF Server parsing .js files...

2001-04-08 Thread Jared Clinton

Whoooaa :) overkill.. but similar to what I would have responded..

Don't change your .js files to .cfm files or mess with your server 
extensions or cfinclude them. That's not how the browser uses the .js 
files.

If you want to include CF variables in your .js files, do this.

In a separate WriteJSOutput.cfm file, process the CF variables, and then
use 
CFFILE to write to your .js file.


This answer rocks!!! :)

 Why not leave the file as a .cfm file but put CFCONTENT 
 TYPE="application/x-javascript" at the top?
 
 Keith C. Ivey [EMAIL PROTECTED]
 Webmaster, EEI Communications
 66 Canal Center Plaza, Suite 200
 Alexandria, VA  22314
 Telephone:  703-683-0683
 Fax:  703-683-4915
 Web Site:  http://www.eeicommunications.com


Anyway, for my mediocre answer:
I set any CF-javascript variables BEFORE the javascript file reference is
made in the result HTML.
Set them as normal javascript variables, which are globally scoped to the
page.

eg. 

cfset CFMjscriptVarforExample = 'I will be passed to a .js file which can
manipulate me'
cfoutput
 script
var jscriptVarforExample = #CFMjscriptVarforExample#
 /script

 script src="/javascript/jsFileWhichExpects_jscriptVarforExample.js" 
 /script
/cfoutput


Jared Clinton.
Maxi Multimedia.

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CF Server parsing .js files...

2001-04-07 Thread Freddy

Remember if the js file is included lik this:
Script language="Javascript" src="/src/dynapi.js"/script
you have to wrap the include in a:
 script language="JavaScript"
  cfinclude template="/dd/src/dynapi.js"
/script
In the preceding instance the src directory is on the root of the site and the site 
has a coldfusion mapping of dd.

 Hope that helps.
 Frederic

Dave Hannum wrote:

 The only way I can think of would be to wrap it in a CFINCLUDE inside a .cfm
 page.

 Dave

 - Original Message -
 From: "Steve Reich" [EMAIL PROTECTED]
 To: "CF-Talk" [EMAIL PROTECTED]
 Sent: Friday, April 06, 2001 1:16 PM
 Subject: CF Server parsing .js files...

  I have a single javascript file (*.js) that I want to include CF variables
  with. I know how to set IIS up to allow CF Server to process a specific
 file
  extension, but I don't neccessarily want it to process all .js files. My
  question is
 
  Is there any command I can use to only process the single file or if  I
 want
  CF Server to process one, it has to do them all?
 
  CF_ProcessThisJSFileOnly
 
  ...js file contents.
 
  /CF_ProcessThisJSFileOnly
 
  Anything like that? I know I'm reaching here and am pretty positive I
 can't
  do this, but I thought I'd ask anyway...
 
  Thanks,
  Steve
 
 
 
 

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: CF Server parsing .js files...

2001-04-07 Thread ron

  That's the way we do it... works like a champ. When your stylesheets get
  big, you really should link to them, rather than include them, so that
  browsers can cache them and speed up all your pages. Works for us in
  Netscape, too, vs. Steve's experience in the next post.


 It's not a stylesheet. It's a javascript source file that I'm trying to
 include with CF variables

Sorry, Steve. I meant javscript source file. Got confused because we use the
same technique for .js and .css.

 This works fine in IE and NS...

   script language="javascript" src="myfile.js"/script

 This works in IE but not in NS...

   script language="javascript" src="myfile.cfm"/script

 I'm thinking I need to find another approach to what I'm trying to do.
 Netscape seems to need the .js extension to reference as a valid source
 file.

Not true. Check out http://www.fuselets.com/cftips/ with Netscape, then take
a look at the script tag's source on that page... it's a .cfm file. Works
on all flavors of NS, even Mac. You just need to use the cfcontent tag to
set the headers correctly.

Ron Allen Hornbaker
President/CTO
Humankind Systems, Inc.
http://humankindsystems.com
mailto:[EMAIL PROTECTED]





~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: CF Server parsing .js files...

2001-04-07 Thread I-Lin Kuo

Don't change your .js files to .cfm files or mess with your server 
extensions or cfinclude them. That's not how the browser uses the .js 
files.

If you want to include CF variables in your .js files, do this.

In a separate WriteJSOutput.cfm file, process the CF variables, and then use 
CFFILE to write to your .js file.
_
Get your FREE download of MSN Explorer at http://explorer.msn.com


Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



CF Server parsing .js files...

2001-04-06 Thread Steve Reich

I have a single javascript file (*.js) that I want to include CF variables
with. I know how to set IIS up to allow CF Server to process a specific file
extension, but I don't neccessarily want it to process all .js files. My
question is

Is there any command I can use to only process the single file or if  I want
CF Server to process one, it has to do them all?

CF_ProcessThisJSFileOnly

..js file contents.

/CF_ProcessThisJSFileOnly

Anything like that? I know I'm reaching here and am pretty positive I can't
do this, but I thought I'd ask anyway...

Thanks,
Steve



~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CF Server parsing .js files...

2001-04-06 Thread Jason Lotz

I believe that if you cfinclude the .js file, CF automatically parses it,
even though it isn't a .cfm file.

In other words, cfinclude template="myjsfile.js" will process
'myjsfile.js' as if it were a .cfm file.

Jason

- Original Message -
From: "Steve Reich" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Friday, April 06, 2001 10:16 AM
Subject: CF Server parsing .js files...


 I have a single javascript file (*.js) that I want to include CF variables
 with. I know how to set IIS up to allow CF Server to process a specific
file
 extension, but I don't neccessarily want it to process all .js files. My
 question is

 Is there any command I can use to only process the single file or if  I
want
 CF Server to process one, it has to do them all?

 CF_ProcessThisJSFileOnly

 ..js file contents.

 /CF_ProcessThisJSFileOnly

 Anything like that? I know I'm reaching here and am pretty positive I
can't
 do this, but I thought I'd ask anyway...

 Thanks,
 Steve





~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CF Server parsing .js files...

2001-04-06 Thread Dave Hannum

The only way I can think of would be to wrap it in a CFINCLUDE inside a .cfm
page.

Dave


- Original Message -
From: "Steve Reich" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Friday, April 06, 2001 1:16 PM
Subject: CF Server parsing .js files...


 I have a single javascript file (*.js) that I want to include CF variables
 with. I know how to set IIS up to allow CF Server to process a specific
file
 extension, but I don't neccessarily want it to process all .js files. My
 question is

 Is there any command I can use to only process the single file or if  I
want
 CF Server to process one, it has to do them all?

 CF_ProcessThisJSFileOnly

 ...js file contents.

 /CF_ProcessThisJSFileOnly

 Anything like that? I know I'm reaching here and am pretty positive I
can't
 do this, but I thought I'd ask anyway...

 Thanks,
 Steve




~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CF Server parsing .js files...

2001-04-06 Thread Keith C. Ivey

On 6 Apr 2001, at 13:16, Steve Reich wrote:

 I have a single javascript file (*.js) that I want to include CF
 variables with. I know how to set IIS up to allow CF Server to
 process a specific file extension, but I don't neccessarily want
 it to process all .js files.

Why not leave the file as a .cfm file but put CFCONTENT 
TYPE="application/x-javascript" at the top?

Keith C. Ivey [EMAIL PROTECTED]
Webmaster, EEI Communications
66 Canal Center Plaza, Suite 200
Alexandria, VA  22314
Telephone:  703-683-0683
Fax:  703-683-4915
Web Site:  http://www.eeicommunications.com

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CF Server parsing .js files...

2001-04-06 Thread Steve Reich

 Why not leave the file as a .cfm file but put CFCONTENT
 TYPE="application/x-javascript" at the top?

I tried renaming the .js file to a .cfm file and it worked like a champ
until I opened the page in Netscape... it doesn't seem to want to accept it
as a javascript source file. Worked perfect in IE (as usual). Any
suggestions?

Thanks,
Steve



~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: CF Server parsing .js files...

2001-04-06 Thread ron

  I have a single javascript file (*.js) that I want to include CF
  variables with. I know how to set IIS up to allow CF Server to
  process a specific file extension, but I don't neccessarily want
  it to process all .js files.

 Why not leave the file as a .cfm file but put CFCONTENT
 TYPE="application/x-javascript" at the top?

That's the way we do it... works like a champ. When your stylesheets get
big, you really should link to them, rather than include them, so that
browsers can cache them and speed up all your pages. Works for us in
Netscape, too, vs. Steve's experience in the next post.

-ron



~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CF Server parsing .js files...

2001-04-06 Thread Steve Reich

 That's the way we do it... works like a champ. When your stylesheets get
 big, you really should link to them, rather than include them, so that
 browsers can cache them and speed up all your pages. Works for us in
 Netscape, too, vs. Steve's experience in the next post.


It's not a stylesheet. It's a javascript source file that I'm trying to
include with CF variables

This works fine in IE and NS...

script language="javascript" src="myfile.js"/script

This works in IE but not in NS...

script language="javascript" src="myfile.cfm"/script

I'm thinking I need to find another approach to what I'm trying to do.
Netscape seems to need the .js extension to reference as a valid source
file.


Steve


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists