jQuery call to return result (simple value)


This is not a Lucee question but rather jquery’s ajax call to return a simple value.

code looks like this:
$.get("myCFC.cfc?method=CheckStatus",{id:i, Name:name},function(data){console.log(data);});

// this CFC would return either 1 or 0

debugging output looks this:
` Dev App

some rendered html code here...

<wddxPacket version=‘1.0’><header/><data><number>1.0</number></data

what I need to return is the 1 or 0 simple value from the myCFC call. what do I need to do?


try a returnType=“json” on the checkStatus function?

No, that bombed out, when I didn’t specify returnType it seemed to use “numeric” for when I used returnType=“numeric” it returned the same as I posted.

In the meantime, I’ve opted to another solution. Thanks tho.

You actually need returnFormat="JSON" in the component.

For future viewers of this thread, this actually works:


<!DOCTYPE html>
	<title>Get test</title>

  			{id:"2", Name:"Hello"},

And the myCFC.cfc :

component {
	remote numeric function CheckStatus(numeric id, string Name)
		return 1;

This returns you 1 with the right application/JSON header.

Looks like remote components return WDDX by default, which might seem a bit outdated now IMHO.

Mark, you’re the man!