Discussion:
CFAJAX creating invalid XHTML
(too old to reply)
simonhume
2009-03-24 09:33:35 UTC
Permalink
Hi folks,

We've just had our servers upgraded to Coldfusion 8, from stone age CF6, and
we're mightly impressed.

The problem we're facing though, is some code that gets inserted inside the
<head> tags of our HTML pages, which causes the W3C validation to fail.

It references the loading.gif wheel for the ajax content to load.

I work in Local Government, and we get heavily checked on code quality.

The page in question is this:

http://www.stratford.gov.uk/labs/news/

The tools work fine, it's just this that gets posted in the <head> tags:

<script type="text/javascript">_cf_loadingtexthtml="<img alt=' '
src='/cfajaxscripts/scripts/ajax/resources/cf/images/loading.gif'/>";
_cf_contextpath="";
_cf_ajaxscriptsrc="/cfajaxscripts/scripts/ajax";
_cf_jsonprefix='//';
</script>


Any help on fixing this issue would be great, we've tried everything!


Simon
Azadi
2009-03-24 09:57:55 UTC
Permalink
sorry to tell you this, but there is no "fix" for this issue if you are
using built-in cf ajax features...

hopefully cf9, aka centaur, will fix that...

meanwhile, you may consider just not using cf's built-in ajax
features... there is at least one other option out there, based on
jQuery, that does all the same things (including an alternative to
cfajaxproxy!), without generating invalid html/xhtml... i fail to find
the link to it now, but search cfbloggers.com and you will find it.

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
simonhume
2009-03-24 10:03:23 UTC
Permalink
I had a feeling the answer would be 'no fix'.

Thanks for taking the time to reply, I'll have a look at the jQuery stuff
instead.

Let's hope they can offer out a patch for CF8, it'll probably be a while
before we get upgraded to CF9 upon it's release!

I did wonder whether there was a magic way of replacing the code with
something that does validate, but as it seems to be generated from deep inside
ColdFusion that would appear impossible!

Thanks again :)
Azadi
2009-03-24 12:09:59 UTC
Permalink
as soon as you use any cf8 "ajaxy" tag, it places that silly code up
there. and there is no way you can stop it doing this....

that's why i always use something else like jQuery for the
publicly-accessible parts of the sites (in protected Admin area it does
not matter so much in my projects).

btw, cf9 is a lot closer than you might think...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

Loading...