InvalidStateError in internet explorer 11 during blob creation

前端 未结 4 1045
灰色年华
灰色年华 2020-12-19 07:36

I\'m getting an InvalidStateError at the blob creation line on IE 11. Needless to say, it works in Chrome and Firefox. I can see that the binary data is my cli

4条回答
  •  甜味超标
    2020-12-19 08:08

    Is not a elegant way but it works on IE8 - IE11:

    var myForm = document.createElement("form");
    
    myForm.method = "POST";
    myForm.action = strURL;
    myForm.target = "_blank";
    
    var myInput = document.createElement("input");
    myInput.type = "text";
    myInput.name = "sim";
    myInput.value = JSON.stringify(/*data to post goes here*/);
    myForm.appendChild(myInput);
    
    document.body.appendChild(myForm);
    myForm.submit();
    $(myForm).hide();
    

提交回复
热议问题