[Proto-Scripty] Re: Ajax.Request with JSON response

2009-11-01 Thread Michael Haston
ll". -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Alex McAuley Sent: Saturday, October 31, 2009 5:20 AM To: prototype-scriptaculous@googlegroups.com Subject: [Proto-Scripty] Re: Ajax.Request with

[Proto-Scripty] Re: Ajax.Request with JSON response

2009-10-31 Thread Alex McAuley
If its Json then the alert would be... alert(jsonObj.success); HTH Alex Mcauley http://www.thevacancymarket.com - Original Message - From: "mjhaston" To: "Prototype & script.aculo.us" Sent: Friday, October 30, 2009 1:21 PM Subject: [Proto-Scripty] Re: Ajax.Re

[Proto-Scripty] Re: Ajax.Request with JSON response

2009-10-31 Thread mjhaston
The "success" alert fires off, but not the "feeling ok" alert. function ajaxRequest2(){ var url = "/cgidev2p/r_chgpwd.pgm"; var pars = 'v_current=' + escape($F('v_current')) + '&v_new=' + escape($F('v_new')) + '&v_confirm=' + escape($F ('v_confirm'))

[Proto-Scripty] Re: Ajax.Request with JSON response

2009-10-31 Thread mjhaston
I can see the Ajax.Request fired off and message response via FireBug. I don't get any alerts though. function ajaxRequest2(){ var url = "/cgidev2p/r_chgpwd.pgm"; var pars = 'v_current=' + escape($F('v_current')) + '&v_new=' + escape($F('v_new')) + '

[Proto-Scripty] Re: Ajax.Request with JSON response

2009-10-30 Thread Lapis
Sorry, I meant to write: But you are sending json with the properties 'success' and 'message', On Oct 30, 9:56 am, Lapis wrote: > But you are sending json with the properties 'success' and 'value', --~--~-~--~~~---~--~~ You received this message because you are s

[Proto-Scripty] Re: Ajax.Request with JSON response

2009-10-30 Thread Lapis
But you are sending json with the properties 'success' and 'value', and in the callback you use my example code, which tries to alert the values of properties 'feelingOk' and 'value'? Also, make sure you have set the response's content type to application/json. /L On Oct 30, 2:38 am, "Michael Ha

[Proto-Scripty] Re: Ajax.Request with JSON response

2009-10-29 Thread Michael Haston
Didn't seem to work for me. I might have it wrong. Code ... function ajaxRequest2(){ var url = "/cgidev2p/r_chgpwd.pgm"; var pars = 'v_current=' + escape($F('v_current')) + '&v_new=' + escape($F('v_new')) + '&v_confirm=' + escape($F('v_co

[Proto-Scripty] Re: Ajax.Request with JSON response

2009-10-29 Thread Lapis
>From a Java horizon it would be: writer.print("{success : true, message : 'good'}"); or writer.print("{success : false, message : 'bad'}"); (writing to the response's PrintWriter) Hoping I am not misinterpreting your question right now. /L On Oct 29, 4:19 pm, wrote: > What would my json re

[Proto-Scripty] Re: Ajax.Request with JSON response

2009-10-29 Thread michael
What would my json response look like (syntax-wise) in this case? On Thu, 29 Oct 2009 07:28:43 -0700 (PDT), Lapis wrote: > I think I'd do it more like this, if i just wanted JSON as the > response: > > On the server: set the response type to "application/json", something > to the equivalent of

[Proto-Scripty] Re: Ajax.Request with JSON response

2009-10-29 Thread Lapis
I think I'd do it more like this, if i just wanted JSON as the response: On the server: set the response type to "application/json", something to the equivalent of => response.setContentType("application/json") Then print your json object to the response (java stylee again): writer.print(String.f

[Proto-Scripty] Re: Ajax.Request with JSON response

2009-10-28 Thread mjhaston
Found some examples on this site and tried to simplify it. var pars = 'v_current=' + escape($F('v_current')) + '&v_new=' + escape($F('v_new')) + '&v_confirm=' + escape($F('v_confirm')) + '&sessionid=' + escape($F('sessionid')); new