Hi, I am newbie to rails. I use an jquery ajax function to get some json data and have to render an image according to the result.
say
Hi, I am newbie to rails. I use an jquery ajax function to get some json data and have to render an image according to the result.
say
I use an jquery ajax function to get some json data and have to render an image according to the result.
Not really a Rails question, but...
JS: if (true){ $('#status').html(<%=IMAGE1%>); } else{ $('#status').html(<%=IMAGE2%>); }
? Why don't you just return the appropriate image tag in your JSON response, and insert it, e.g. $('#status').html(new_image_tag ?