dongren4758 2013-12-09 16:59 采纳率: 0%
浏览 281

JQuery Ajax请求不起作用

I have an issue with a Ajax request. I used a lot of Ajax and never had problems but in this case it just does not work and I am looking for days into it now and can't find my error.

If you go to: http://sites.ondalocal.com.br/onodera/ Then submit the form with the button that says "Agendar agora!".

By clickung the following code is executed:

$.ajax({
    type : 'POST',
    url : 'http://186.202.184.93/vhosts/sites/wp-content/themes/Onodera_test/onodera.php',
    dataType : 'json',
    data: {
        site : "1", 
        field : "3" 
    },
    success : function(data){
        alert("ok");
    },
    error: function() {
      alert("error");
    }
});

the called php page does not contain errors. but the success function is never called, it always goes to error.

Could anyone please have a quick look at this?

  • 写回答

2条回答 默认 最新

  • douxie9347 2013-12-09 17:05
    关注

    check console.

    XMLHttpRequest cannot load http://186.202.184.93/vhosts/sites/wp-content/themes/Onodera_test/onodera.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://sites.ondalocal.com.br' is therefore not allowed access. 
    

    Same Origin Policy

    评论

报告相同问题?

悬赏问题

  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
  • ¥15 怀疑手机被监控,请问怎么解决和防止
  • ¥15 Qt下使用tcp获取数据的详细操作
  • ¥15 idea右下角设置编码是灰色的
  • ¥15 全志H618ROM新增分区
  • ¥15 在grasshopper里DrawViewportWires更改预览后,禁用电池仍然显示
  • ¥15 NAO机器人的录音程序保存问题
  • ¥15 C#读写EXCEL文件,不同编译
  • ¥15 MapReduce结果输出到HBase,一直连接不上MySQL