|
I had problems using the coldfusion code presented due to the <?xml?> declaration not being on the first line of the returned document. If whitespace suppression is not turned on in the Administrator you will have to use something like this. Notice that there is no hard return after the <cfcontent> tag.
<cfprocessingdirective suppresswhitespace="yes">
<cfcontent type="text/xml" reset="yes"><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
<method>checkName</method>
<cfoutput><result>#nameInUse(url.q)#</result></cfoutput>
</response>
<cfscript>
function nameInUse(q)
{
if (isdefined("q")){
switch(lcase(q))
{
case 'drew': {
return '1';
break;
}
case 'fred': {
return '1';
break;
}
default:
return '0';
}
}else
return '0';
}
</cfscript></cfprocessingdirective>
|