JavaScript doesn't affect Php return HTML in Ajax
Hi
I'm using sorting table JavaScript code.
request from the server using Ajax
the server (PHP) reply simple table that should be sort using the JavaScript code
when add the table to the HTML body it works perfect, when I' loading through the server (from PHP) the JavaScript doesn't react
what am I doing wrong
here is my Ajax:
$.ajax({
url: mySite+"func=couponSiteNo",
data: "No="+document.CouponNo.CouponSiteNo.value,
async: false,
context: document.body,
success: function (result) {
$("#my_div").html(result);
$("#my_div").listview("refresh");
}
})
my Php:
print('<div id="demo">
<table class="smartTable">
<tr>
<th></th>
<th>Cow</th>
<th>Sheep</th>
<th>Pig</th>
<th>Dog</th>
</tr><tr>
<td>Name</td>
<td>Daisy</td>
<td>Fluffy</td>
<td>Oinky</td>
<td>Barky</td>
</tr><tr>
<td>Height</td>
<td>180cm</td>
<td>121cm</td>
<td>100cm</td>
<td>056cm</td>
</tr><tr>
<td>Deliciousness</td>
<td>85%</td>
<td>68%</td>
<td>93%</td>
<td>13%</td>
</tr><tr>
<td>Noise</td>
<td>Moo</td>
<td>Baa</td>
<td>Oink</td>
<td>Woof</td>
</tr>
</table>
</div>');