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.

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

报告相同问题?

悬赏问题

  • ¥30 vmware exsi重置后的密码
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面