im试图回显ajax的结果;
我的php代码是
if(isset($_POST['date']) )
{
echo "<input type='radio' id='date'/>";
}
和我的ajax代码:
$.ajax(
{
type: "POST",
url: "schedule.php",
data: {date: dateAsString},
success: function(result)
{
$('#res').text(result);
// i know this is .text that's why printing text instead of html input.
// i don't know what line of code to execute my php into html command
}
});
如何用html语言回显php代码行以打印输入
更改
$('#res').text(result);
至
$('#res').html(result);