Thanks for the tip on the content type.
I've been living with syntax highlighting since
js highlighting was applied because of the .cfm extension
and cf doesn't highlight the js. :oP

Perhaps now I can have my cake and eat it, too! :o)


-----Original Message-----
From: denstar [mailto:valliants...@gmail.com] 
Sent: Wednesday, October 27, 2010 7:33 PM
To: cf-talk
Subject: Re: Question about using javascript in .cfm files...


It's pretty much exactly the same.  Even more exacter if you set the
content type to text/javascript or whatever using cfcontent.

:Den

-- 
Custom is our nature. What are our natural principles but principles of
custom?
Blaise Pascal

On Wed, Oct 27, 2010 at 11:44 AM, Rick Faircloth wrote:
>
> I've been using js files as .cfm files
> so I can intermix cf variables in the js.
>
> i.e., naming myJSFile.js, "myJSFile.js.cfm", instead.
>
> This seems to work fine, but I've run into an issue
> that makes me wonder if this works in all cases as
> a regular js file would.
>
> Here's the question:
>
> If I have a js function in a .cfm file, would the
> declared function be defined by the browser
> upon first entering a page as it would if the function
> were in a .js file?
>
> e.g., should the function "checkUserFavorites":
>
> function checkUserFavorites(USERID) {
>
>        blah, blah, blah
>
> be defined if the js were in a .cfm file as readily
> as it would in a .js file?
>
> I keep running into a "checkUserFavorites is not defined"
> for which I cannot track down the problem.
>
> I'm reaching for an answer at this point, because I can't
> otherwise explain the error message otherwise, yet.
>
> Thanks for any feedback.
>
> Rick
>
>
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338634
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to