[jQuery] Re: ajax returned data format

2009-09-24 Thread Flo
Thanks for your answers. I'm pretty sure my ajax call is done, thanks to firebug (which is great by the way) and a few 'alert'. I suspected extra white space (I must try a javascript trim...) at the end of my string, I'll try JSON (must learn about it before). Great idea to return an array too, wi

[jQuery] Re: ajax returned data format

2009-09-23 Thread morris...@ingenious.org
Flo, I would suggest using $.getJSON() instead of the straight $.get() if you have the json_encode function available to you (PHP 5.2.x+ should have this). This is because you may have some extra white space at the end of what you are returning now. in your php do this 'ok')); ?> in js do thi

[jQuery] Re: ajax returned data format

2009-09-23 Thread James
That should work. Is there more to the code you didn't post? Are you sure that the AJAX call is being done? If you do: function(data) { alert(data); if(data == "ok") { ...do stuff... } } does the content alert? Try to use Firebug for Firefox to debug AJAX calls. On Sep 23, 5:24 am, F