weixin_33711641 2016-01-02 09:09 采纳率: 0%
浏览 5

返回HTML Ajax

below is my code to fetch a webpage html....

$.ajax({
    url: 'server.php',
    method: 'POST',
    dataType : "html",
    data: {name: 'film'},
    success: function(data) {
     console.log(data);
    });
});

server.php wil return ...

return <div>some html contents</div>

I want to show this in ajax console success function....now its not displaying anything in console.. how do we fix this....

  • 写回答

1条回答 默认 最新

  • ??yy 2016-01-02 09:18
    关注

    Credit goes to @Rayon Dabre , As he mentioned, I have solved the problem.... by writing echo <div>some html contents</div> instead of return <div>some html contents</div>

    评论

报告相同问题?