当通过包含html标签的ajax检索数据时,将检索为字符串,而不是在html中显示为标签

时间:2014-02-22 17:39:02

标签: php jquery html ajax

我通过包含列表标签(li)的ajax检索数据但是当通过ajax html函数时我将其显示在 ul它不把它当作li而是显示为字符串 我的ajax代码是

<?php

include 'classes/connection_and_crud.php';

$query = "select *from admin_notifications where status=1 AND receiveFrom='doctors'";
$result = mysql_query($query) or die(mysql_error());
$num = mysql_num_rows($result) ;
////
$query1 = "select *from admin_notifications where receiveFrom='doctors'";

$result1 = mysql_query($query1);
?>
<li>
    <p>You have <?php echo $num; ?> Messages</p>
</li>

1 个答案:

答案 0 :(得分:1)

通过html_entity_decode()函数传递数据。

http://nl1.php.net/html_entity_decode