var js_sitename = '#js_sitename#';
var js_website = '#js_website#';
var js_site_manager_dsn = '#js_site_manager_dsn#';
var js_client_dsn = '#js_client_dsn#';
<cfhtmlhead text = "#jsVariables#" />
Why would putting this code directly in the head of each page
be better than using cfhtmlhead?
From: Andrew Scott [mailto:andrews@andy...]
Sent: Tuesday, May 22, 2012 4:19 PM
Subject: Re: How to prevent cfhtmlhead content from being inserted into
Rick that might be a good case to think about the application, and one
reason why you need to keep things out of the Application.cfc that really
don't need to be there.
If you must continue with it, then you might need to look for a conditional
statement to not include the JS etc for the CFHTMLHEAD, but on the other
side of your question you can use cfsavecontent to create a variable and
use that with CFHTMLHEAD.
On Wed, May 23, 2012 at 4:26 AM, Rick Faircloth
> Hi, all...
> I've got a cfhtmlhead tag set up in my application CFC that
> defines some JS variables for CF use and vice-versa. They're inserted into
> head of every page.
> I noticed, when running an sequence involving an HTML form - jQuery ajax
> call -
> CFC method - and JSON data return, that the JS variables are being
> into the JSON return data from the ajax call. This is throwing off my
> "success" processing after the call.
> Is there any way to prevent the JS being output using cfsavecontent and a
> in the CFC from ending up in the JSON data return? The CFMAIL is processed
> and the mail goes out, but the extra data beyond "success" in the JSON is
> and further JS statement from processing...basically, the "Processing..."
> isn't being hidden and the "Thank You" message isn't being shown after the
> is processed and the mail is sent.
> I didn't want to get into all the code up front in case there's a simple
> to handle this.
> Thanks for any feedback! If you need to see some code, let me know!