On 3/16/11 10:52 AM, Aparajita Fishman wrote:
>> The simple fix was to escape() all of the Collaborator.data variables.
> Yes, you must encode all of your form values. But don't use escape(), it is
> deprecated. Use encodeURIComponent() instead.
>
Aparajita,
Thanks for that tip.
I have another question. Is it possible to put a collection into an
existing collection and convert that to JSON?
While I'm debugging this AJAX stuff I want to include what was
posted in the JSON'd response.
I have a $response collection.
In my form processor code I've tried
$response{'post'} := _form
I've also tried the old style
set collection("post";_form)
and
$post := _form
set collection("post";$post)
Active 4D throws an error:
/Library/Application
Support/4D/com.aparajita/Active4D/web/ajax/iopr/collab-submit.a4d
[main] 31
[text block] a4d.json.add 14
[text block] a4d.json.encode 7
[text block] a4d.json.encodeCollection 36
[text block] a4d.json.encodeCollection 13
$it := collection($inCol)
Invalid collection handle
My JSON code is simply:
// Return response as JSON
$json := a4d.json.new()
$json->add("response";$response)
write($json->toJSON)
-- Brad
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/