[Plone-IT] Ajax, Script e Zpt
Riccardo Lemmi
riccardo a reflab.it
Mar 13 Apr 2010 14:07:52 UTC
On Tuesday 13 April 2010, you wrote:
> ...
> Usando jquery 1.3.2 FUNZIONA tutto. Il dubbio mi è venuto leggendo questo:
>
> *Important:* As of jQuery 1.4, if the JSON file contains a syntax error,
> the request will usually fail silently. Avoid frequent hand-editing of JSON
> data for this reason. JSON is a data-interchange format with syntax rules
> that are stricter than those of JavaScript's object literal notation. For
> example, all strings represented in JSON, whether they are properties or
> values, must be enclosed in double-quotes. For details on the JSON format,
> see http://json.org/.
>
> Assurdo. Evidentemente quello che il pythonscript gli ritorna non è JSON
> cosi puro come credevo, nonostante firebug riesca a elaborarlo come
> tale...A qualcuno viene in mente un workaround per questa cosa? O magari
> avreste scritto il return del mio script diversamente?
http://www.json.org/
http://www.json.org/example.html
Le funzioni dovrebbero ritornare 'object' cioè un dizionario, lo script
ritorna un 'array', dovrebbe essere una cosa tipo:
return { "items": [
{"optionValue":"03", "optionDisplay":"roma"}
]
}
comunque per essere tranquilli si deve usare una libreria json.
--
Riccardo Lemmi Email: riccardo a reflab.it
Reflab S.r.l. - Plone Design, Development and Consulting
Phone: +39 349 4620820 http://www.reflab.it
-------------- parte successiva --------------
Un allegato non testuale è stato rimosso....
Nome: signature.asc
Tipo: application/pgp-signature
Dimensione: 189 bytes
Descrizione: This is a digitally signed message part.
URL: <http://lists.plone.org/pipermail/plone-plone-it/attachments/20100413/116cbe47/attachment.asc>
Maggiori informazioni sulla lista
Plone-IT