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
----------------------------------------------------------------------
HTML:
<div id="status"></div>
----------------------------------------------------------------------
JS:
if (true){
$(''#status'').html(<%=IMAGE1%>);
}
else{
$(''#status'').html(<%=IMAGE2%>);
}
-----------------------------------------------------------------------
I''ve tried a lot of way but couldn''t come to a solution.
Please help.
Regards,
Vimal Das
On Tue, Apr 28, 2009 at 12:31 AM, vimal <cool.vimalsmail-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 ? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org