cfajaximport ‘Coldfusion’ is not defined error
Written in March 2011 and kept here as it was. Some of what follows has been overtaken by events.
A tip for anyone who’s getting a “‘Coldfusion’ is not defined” error on Coldfusion 8/9 when using cfajaximport: check your virtual directories.
I spent some time this morning trying to work this one out but it was a simple solution in the end.
What was confusing me was that I could view the source of my CFML file in Firefox…
…and when I clicked on the script links, I could access the corresponding code…
Yet somehow the Javascript wasn’t working.
The solution was simple – although the CFIDE virtual directory was mapped correctly in Coldfusion Administrator…
…there was not an equivalent in IIS.
I added the virtual directory to IIS and now Bob is my proverbial uncle – cfajaximport works just fine.
I’m not an expert on Apache/Tomcat etc but I suspect the same issue crops up on that platform and can be fixed similarly easily.

