当我这样做时:
$("#main").load("list.html");
代码工作正常,但是当我这样做时:
$.post("mycode.php")
.done(function(data) {
$("#main").load(data);
})
和mycode.php是:
$data = file_get_contents("list.html");
echo $data;
我得到:myrootURL/%3C!DOCTYPE 404 not found
我检查了从帖子请求中返回的数据,它确切地说是list.html的内容 请帮忙
答案 0 :(得分:3)
$.post("mycode.php")
.done(function(data) {
$("#main").html(data); //<-html not load
})