Question

I have this meta tag:

<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />

that I need to put just before the tag. But I have also further in the cf code this:

<cfajaximport scriptsrc="cfscripts/" csssrc="cfscripts/ajax/">

that generates a whole bunch of instruction in the source code of the page, like this:

script type="text/javascript">/* <![CDATA[ */_cf_loadingtexthtml="<img alt=' '             src='/CFIDE/scripts/ajax/resources/cf/images/loading.gif'/>";
_cf_contextpath="";
_cf_ajaxscriptsrc="/CFIDE/scripts/ajax";
_cf_jsonprefix='//';
_cf_clientid='34E7CEE60001694E2BAD23DBDEE4C6DE';/* ]]> */

That make my meta tag not usefull anymore.

Is there a way to oblige ColdFusion to put this tag at the very beginning to the head ?

Thank you in advance, Michel

Was it helpful?

Solution

You can specify X-UA-Compatible as a real HTTP header (instead of using HTML's http-equiv in a meta tag), which will ensure it applies before any HTML/JS is output.

The simplest way is probably to set it at the front-end web server level - how to do this depends on your web server (e.g. Apache, IIS, nginx, etc), or you can use cfheader to do it with CF:

<cfheader name="X-UA-Compatible" value="IE=9; IE=8; IE=7; IE=EDGE" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top