dreamer2014520 2014-09-30 18:46 采纳率: 0%
浏览 88
已采纳

Internet Explorer要求下载POST请求

I have inherited a PHP script that does a lot of logic with in-url POST. Once we make the request within IE9, it asks the user for a download of type "true" with a size that closely resembles the POST request. At no point do we see any behavior where the data isn't being saved on the server -- the expected behavior after submit is to simple ask for a download.

The actual POST call is being fired using jQuery.ajax:

$.ajax({
  type: "POST",
  url: "profile/edit-profile-info.php",
  data:"mail="+mail,
  success: function() {
    console.log('Success!!!');
    location.reload('true'); //Reloads the page with the form
  }
}).done(function() {
    console.log('Done!!!');
    location.reload('true'); //Reloads the page with the form
});

And the reload command is inherited within the browser object space, from what I can tell.

The actual PHP script that handles this data essentially saves the data in an ORM (not in the code) and returns a request as text/plain

header('Content-Type: text/plain; charset=utf-8');
$data->record->mail = $_POST['mail'];

We tried sending another Content Type as a request and it fails to function in Chrome, Firefox, et al.

Looking at the inherited HTML, the fields are populated in a hierarchy without a form tag, which gives me pause as to that being the cause. I'm not entirely sure if that's a culprit. Unfortunately I can't readily give out a demo for review. But if anyone has seen this or has any ideas on the cause, insight would be appreciated.

  • 写回答

1条回答 默认 最新

  • dongyanjing5975 2014-10-02 20:06
    关注

    Remove the commas around true in location.reload('true'); it requires a boolean and your inputting it as a string which is not what IE is expecting.

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

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器