CF 8 bug: ColdFusion injecting cfscript in HTML head

Written on 20 July 2011, 02:13pm

Tagged with: , ,

I recently encountered the following ColdFusion problem:
I had a HTML page where the head node contained an attribute: <head lang="fr">
The same page was also using some cfform tags.
On the CF 8 server, ColdFusion automatically injects two <script> statements immediately after <head, but ignoring any other attribute. So, in our case, the resulting HTML code was:

<head <script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>
lang="fr">

Useless to say, this was breaking a lot of things in the design and the validation of the page.

After doing some research, I found on Stack Overflow the exact same problem I encountered. It looks like it’s simply a ColdFusion bug.

Luckily for me, in my particular case the solution was to move the lang attribute from <head> to <title> (where I was really needing it).

More information about the HTML lang attribute: http://www.w3.org/TR/html4/struct/dirlang.html

Comments (1)

  1. bowo — November 20, 2012 at 03:56

    still not resolved for my case..

    cfscript after Head tag is very disturb Compatibility View on IE ..

    Reply

Leave a response