怎么解决在导出xml文件时网页上显示Failed to execute ‘createObjectURL‘ on ‘URL‘ Overload resolution failed
时间: 2024-01-09 10:38:40 浏览: 139
根据引用\[1\]和引用\[2\]的内容,解决在导出XML文件时网页上显示"Failed to execute 'createObjectURL' on 'URL': Overload resolution failed"的问题,可以采用以下方法:
1. 首先,需要将原来的代码中的`link.href = window.URL.createObjectURL(blob)`这一行代码修改为`link.href = window.URL.createObjectURL(new Blob(\[blob\], {type}))`,这样可以解决Chrome更新后不支持旧的用法的问题。
2. 其次,确保在创建Blob对象时,传入正确的参数。根据引用\[3\]的内容,可以使用`new Blob(\[blob\], {type: 'application/xml;charset=UTF-8'})`来指定正确的MIME类型和字符集。
通过以上修改,应该能够解决在导出XML文件时网页上显示"Failed to execute 'createObjectURL' on 'URL': Overload resolution failed"的问题。
#### 引用[.reference_title]
- *1* [Failed to execute ‘createObjectURL‘ on ‘URL‘ Overload resolution failed](https://blog.csdn.net/fwdwqdwq/article/details/123345822)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [解决 Failed to execute ‘createObjectURL‘ on ‘URL‘ Overload resolution failed](https://blog.csdn.net/weixin_48353638/article/details/130153825)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Failed to execute ‘createObjectURL‘ on ‘URL‘: Overload resolution failed.](https://blog.csdn.net/Amnesiac666/article/details/124411519)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文