vendredi 4 septembre 2015

How to show images with data parse from json use html tag?

I have data parse from json as "true" and "false" . i want to show images from follow . I use html tag

   dataType: "json",
                success: function (data) {
                    $.each($.parseJSON(data.d), function (idx, obj) {
                        $("#div_func tbody").append(
                        '<tr>' +
                            <% if (%> +obj.FLAG == true+ <%){ %>
                                '<td><img src="theme/images/true.png" /></td>' +
                            <% }else{ %>
                                '<td><img src="theme/images/false.png" /></td>' +
                            <% } %>
                        ' </tr>');
                    });

It's show error Invalid expression term ')' .

Aucun commentaire:

Enregistrer un commentaire