Blob createObjectURL download not working in Firefox (but works when debugging)

前端 未结 3 1020
野性不改
野性不改 2020-12-04 17:31

I have an odd problem, the function below is one I created based on what i found on the net about creating a Blob in the client on the fly with some binary data in (passed a

3条回答
  •  醉梦人生
    2020-12-04 17:59

    You're probably removing the resource too soon, try delaying it

        ...
        a.click();
        setTimeout(function(){
            document.body.removeChild(a);
            window.URL.revokeObjectURL(url);  
        }, 100);  
    }
    

提交回复
热议问题