Page 1 of 1

AJAX Returning all False

Posted: Mon Aug 02, 2010 12:54 pm
by JonathanStanton
All my AJAX is returning false, I think it could be something about serializing my data but I'm not exactly sure what that means. However this is my jQuery AJAX Post

[text]
$.post(
"post_updateImages.php",
function(data){
if (data.success)
$("#fileView").css({'color':'green'}),
$("#fileView").html(data.message);
else
$("#fileView").css({'color':'red'}),
$("#fileView").append("failure");
},
"json"
);
[/text]

in FireBug my response comes back like this:
[text]
{"success":true,"message":"<img src='uploaded\/07312010075.jpg'\/> <br><img src='uploaded\/07312010074.jpg'\/> <br><img src='uploaded\/07312010073.jpg'\/> <br><img src='uploaded\/07312010072.jpg'\/> <br>"}
[/text]

1) even though my success returns true, JSON automatically finds it false... and it never appends any of my message variable either. could this have something to do with serialize (not sure what that is though)?

Re: AJAX Returning all False

Posted: Tue Aug 03, 2010 4:56 am
by shridhar.govindaiah
Hi JonathanStanton,

There is nothing wrong in ur JSON response.
My suggestion for ur query is, try using 1 or 0, instead of true or false.
Or use double/single quote for success variable value. i.e 'true' or "true".

If possible, give some more detail about problem, so that it ll help us figure out bug.




cheers