Home  >  Article  >  Backend Development  >  新手 php ajax有关问题

新手 php ajax有关问题

WBOY
WBOYOriginal
2016-06-13 10:46:23943browse

新手求助 php ajax问题?
$.ajax
({
  url: 'mycover.php',
  method:"POST",
  data: {arcids:obj.arcid},
  success: function(data) 
  {
alert(data);
if(data == "0")
{//成功
  alert('成功');
}
else
{//不正确
  alert('不正确');
  }
  }
});

奇怪的是 alert(data); 显示出来的是mycover.php 的原代码,不是mycover.php的执行结果.

请问 碰到这个问题该如何处理?

------解决方案--------------------
1、mycover.php 使用了短标记,而 php 配置不允许
2、低级错误,你没用通过 http 协议访问这个程序
------解决方案--------------------
你把data用js插入到一个div或者什么元素中间(你需要使用到data的地方) 这样子运行页面就可以在浏览器上面显示效果啦

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn