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代码行以打印输入
答案 0 :(得分:0)
更改
$('#res').text(result);
到
$('#res').html(result);