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>

    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序