dry0106 2017-04-15 16:21
浏览 229
已采纳

JQuery Post错误的反应

I want to post an variable to a PHP-File with This:

     $.post( $("#executiveForm").attr("action") ,{id:idvalue},function(response){
        if(response.message === "error"){
            alert("Error");
        }else if(response.message === "okay"){
            location.reload();
        }else{
            alert(response.message);// always undefined
        }
    });

My Problem is, that the Parameter is sent to the PHP-File, but my PHP-File didn't respond. I've added the following Code at the first Line in the PHP-File to get an Error back (To test if the Post reachs the PHP-File):

$makeItFail = "";
echo $makeItFail.error.showMeSomeErrors;

Unfortunately, I only got the respond of my Whole PHP-Page, where I send the Post request... No Errors...

Pls dont answer with "Use $.ajax" or "XML...". I want to use "$.post".

  • 写回答

1条回答 默认 最新

  • dtj88302 2017-04-15 20:49
    关注

    Found the Answer.

    I looked 1000 times but there are not a single PHP File with the same name, but I just renamed my PHP File 1-2 times to something completly Different from before and it worked... I dont know why, but I hope it helps.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试