Hi I am getting an error on IE
TypeError: Object doesn't support this action
This is the code which is failing on IE but working fine on other browsers.
var link = document.createElement('a');
link.href = url;
link.download = 'file';
link.dispatchEvent(new MouseEvent('click'));
The problem is on the link.dispatchEvent
line.
Can anyone please help me to get it working?
较旧版本的IE仅支持专有的等效EventTarget.fireEvent()方法,因此考虑使用所有IE版本完全支持的HTMLElement.click() 。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.