Search code examples
coldfusioncoldfusion-11

Script references inserted in the header


I inherited an older CF site and trying to move it to a different server. There's a problem with the scripts references in the header. They are not accessible and I get a 404 error when trying to navigate to them.

I searched through all my code to find where these scripts could be included, but to no avail.

Does ColdFusion insert references like these automatically or am I missing some source code?

enter image description here


Solution

  • When using ColdFusion tags that require javascript, the javascript source files will be automatically added to the <head> element of your page. This includes <cfform> <cfinput> as well as other non-form related tags, like <cfgrid> and <cfgraph>.

    These source files can be found in either the ColdFusion install directory, or it's also possible that the CF installer added them to your web root folder, which would be install-dependent. Depending on your install, a mapping may have been made in your web server to the cf_scripts folder, which would give your app access to those files.

    As an aside, I personally avoid using coldfusion tags that inject javascript. I prefer to have complete control over the javascript libs that I use, and I don't like to rely on ColdFusion to release bug fixes, add enhancements, or maintain compatibility.