douzhaishan5462 2010-11-18 01:55
浏览 55

使用xhprof profiling PHP代码时,如何防止它破坏JavaScript客户端的Ajax调用?

When I am using xhprof profiling PHP code, it works fine. I reference the documentation written by Lorenzo Alberton, http://techportal.inviqa.com/2009/12/01/profiling-with-xhprof/.

But you know that we always have many Ajax calls in a web application. When I try to include header.php and footer.php in this article, how can I prevent it from destroying the Ajax call from the JavaScript client?

  • 写回答

3条回答 默认 最新

  • douzhan8303 2011-02-16 13:43
    关注

    Have you tried to remove the "Profiler Output" link from your code ? xhprof shouldn't be changing anything since It's just a profiler.

    You can try a if !is_ajax to hide it on ajax requests.

    function is_ajax()
    {
    return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND
    strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest');
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效