javascript - How to append html div to a table in response to jQuery getJSON -



javascript - How to append html div to a table in response to jQuery getJSON -

i'm trying following:

$.getjson("script/course_session.php", data, function(data) { $.each(data, function(i, item) { var $tr = $('<tr>').append( $('<td>').text(item.start_date + " - " + item.end_date), $('<td>').text( '<div class=&quot;col-md-3 btn-buy animated fadeinright&quot;><a href=&quot;#&quot; class=&quot;btn-u btn-u-sm enroll-button&quot;><i class=&quot;fa fa-university&quot;></i> register</a></div>') ).appendto("#session-table"); }); });

the intent beingness accomplish next (i'm using bootstrap):

however, how gets printed:

what right way render html?

you have utilize .html(...) instead of .text(). , " instead of quot;

javascript jquery html css twitter-bootstrap

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -